Skip to content

Commit

Permalink
Merge pull request #5379 from smitterl/passt_negative_setting
Browse files Browse the repository at this point in the history
passt/negative_setting: create interface for testing
  • Loading branch information
chloerh authored Jan 15, 2024
2 parents 4f63166 + 386a412 commit 875d446
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from provider.virtual_network import passt

LOG = logging.getLogger('avocado.' + __name__)
DOWN_IFACE_NAME = "br1234"


def run(test, params, env):
Expand Down Expand Up @@ -73,12 +74,9 @@ def run(test, params, env):
if scenario == 'rm_passt_pgk':
utils_package.package_remove('passt')
elif scenario == 'inactive_host_iface':
inactive_iface_list = [iface for iface in host_iface_list
if iface['operstate'] == 'DOWN']
if not inactive_iface_list:
test.error('No inactive interface on host')
host_iface = inactive_iface_list[0]['ifname']
iface_attrs['source']['dev'] = host_iface
process.run(f'ip link add name {DOWN_IFACE_NAME} type bridge',
shell=True, ignore_status=False)
iface_attrs['source']['dev'] = DOWN_IFACE_NAME
elif scenario == 'non_exist_bind_ip':
bind_ip = ''

Expand Down Expand Up @@ -142,3 +140,5 @@ def _get_test_ip():
else:
del virsh_ins
utils_selinux.set_status(selinux_status)
process.run(f'ip link del {DOWN_IFACE_NAME}',
shell=True, ignore_status=True)

0 comments on commit 875d446

Please sign in to comment.