stages/ovf: test vbox_mac_address
Test that different calls result in different mac addresses (with the same prefix), also test that when the correct options are passed that the mac address is returned as is. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
parent
54ac04e001
commit
ae70eb08d2
1 changed files with 15 additions and 0 deletions
|
|
@ -65,3 +65,18 @@ def test_ovf_default_template(tmp_path, stage_module, test_opts, expected_substr
|
|||
|
||||
for substring in expected_substrings:
|
||||
assert substring in expected_template_path.read_text()
|
||||
|
||||
|
||||
def test_ovf_vbox_mac_address_differs(stage_module):
|
||||
macs = [
|
||||
stage_module.vbox_mac_address({}),
|
||||
stage_module.vbox_mac_address({}),
|
||||
]
|
||||
|
||||
assert macs[0] != macs[1]
|
||||
assert all(m.startswith("080027") for m in macs)
|
||||
assert all(len(m) == 12 for m in macs)
|
||||
|
||||
|
||||
def test_ovf_vbox_mac_address_options(stage_module):
|
||||
assert stage_module.vbox_mac_address({"virtualbox": {"mac_address": "000000000000"}}) == "000000000000"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue