Skip to content

Commit d938e3f

Browse files
committed
Add a test about keeping management address type when disabling
Before it was forced to change into IPv4 and would break IPv6 setups Signed-off-by: Benjamin Reis <[email protected]>
1 parent d1fb97a commit d938e3f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/host.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from packaging import version
88

99
import lib.commands as commands
10+
import lib.pif as pif
1011

1112
from lib.common import _param_add, _param_clear, _param_get, _param_remove, _param_set
1213
from lib.common import safe_split, strip_suffix, to_xapi_bool, wait_for, wait_for_not
@@ -420,6 +421,10 @@ def reboot(self, verify=False):
420421
def management_network(self):
421422
return self.xe('network-list', {'bridge': self.inventory['MANAGEMENT_INTERFACE']}, minimal=True)
422423

424+
def management_pif(self):
425+
uuid = self.xe('pif-list', {'management': True, 'host-uuid': self.uuid}, minimal=True)
426+
return pif.PIF(uuid, self)
427+
423428
def disks(self):
424429
""" List of SCSI disks, e.g ['sda', 'sdb', 'nvme0n1']. """
425430
disks = self.ssh(['lsblk', '-nd', '-I', '8,259', '--output', 'NAME']).splitlines()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Requirements:
2+
# - one XCP-ng host (--host) (>= 8.3 for IPv6 test)
3+
4+
def test_management_disable_address_type(host):
5+
management_pif = host.management_pif()
6+
type = management_pif.param_get("primary-address-type").lower()
7+
8+
host.xe("host-management-disable")
9+
assert management_pif.param_get("primary-address-type").lower() == type
10+
11+
host.xe("host-management-reconfigure", {"pif-uuid": management_pif.uuid})
12+
assert management_pif.param_get("primary-address-type").lower() == type

0 commit comments

Comments
 (0)