tests integ: eth*_up fixtures return the current state

The eth*_up fixtures are used to setup most of the integration tests.
In some scenarios, it is useful to have these interfaces states just
before the test begins.

The fixtures resturn the current interface state.

Signed-off-by: Edward Haas <edwardh@redhat.com>
This commit is contained in:
Edward Haas 2019-06-10 08:46:03 +03:00
parent 6b7bcaac49
commit 9bfabbaeea

View File

@ -43,7 +43,7 @@ def ethx_init(preserve_old_config):
def eth1_up():
_set_eth_admin_state('eth1', 'up')
try:
yield
yield statelib.show_only(('eth1',))
finally:
_set_eth_admin_state('eth1', 'down')
@ -52,7 +52,7 @@ def eth1_up():
def eth2_up():
_set_eth_admin_state('eth2', 'up')
try:
yield
yield statelib.show_only(('eth2',))
finally:
_set_eth_admin_state('eth2', 'down')