integration tests: Remove preserve_old_config fixture

The `preserve_old_config` fixture fails when Nmstate reports a
configuration that it cannot set, for example a gateway together with
DHCPv6 and autoconf. If someone needs to restore a certain network state
after running the tests, they need to use a custom wrapper/script to do
so.

References:
https://lists.fedorahosted.org/archives/list/nmstate-devel@lists.fedorahosted.org/thread/XFMPA5IMYCQCDWUSSNGVDBQA7BKB2N3N/
https://nmstate.atlassian.net/browse/NMSTATE-275

Signed-off-by: Till Maas <opensource@till.name>
This commit is contained in:
Till Maas 2019-11-19 16:06:20 +01:00 committed by Gris Ge
parent a613f56239
commit 759d8a47b9

View File

@ -22,8 +22,6 @@ import subprocess
import pytest
import libnmstate
from .testlib import ifacelib
@ -41,7 +39,7 @@ def logging_setup():
@pytest.fixture(scope='session', autouse=True)
def ethx_init(preserve_old_config):
def ethx_init():
""" Remove any existing definitions on the ethX interfaces. """
ifacelib.ifaces_init('eth1', 'eth2')
@ -62,13 +60,6 @@ port0_up = eth1_up
port1_up = eth2_up
@pytest.fixture(scope='session', autouse=True)
def preserve_old_config():
old_state = libnmstate.show()
yield
libnmstate.apply(old_state, verify_change=False)
def pytest_report_header(config):
return REPORT_HEADER.format(
rpms=_get_package_nvr('NetworkManager'), osname=_get_osname()