Skip to content

Commit

Permalink
Force test:// URI to be used in mocked connections
Browse files Browse the repository at this point in the history
Prior to 801ce47 any URL could be used
when mocking and it had preconfigured responses, but this regressed and
could cause real system connections to go through.

This forces the URL to use the test:// scheme which still allows the use
of test:///path/to/host/definitions as documented.

Fixes: 801ce47 ("Use test:///default in tests")
Reference: https://libvirt.org/uri.html#test-test-uris
  • Loading branch information
ekohl committed Nov 19, 2024
1 parent 238a8b8 commit 47cface
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/fog/libvirt/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ class Real

class Mock
include Shared

def enhance_uri(uri)
uri = 'test:///default' unless ::URI.parse(uri).scheme == 'test'

super(uri)
end
end
end
end
Expand Down

0 comments on commit 47cface

Please sign in to comment.