To keep the test specific configuration in the ipatest package.

Patch attached.

--
Milan Kubik

From 49701f9775e59bd19bc62295af6ed332f1aa054b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Tue, 6 Oct 2015 14:55:49 +0200
Subject: [PATCH] ipatests: remove the ipatests specific config from
 ipaplatform

Move the test only configuration for Network Manager entirely
into ipatests part of the tree.
---
 ipaplatform/base/paths.py               |  1 -
 ipatests/test_integration/env_config.py |  1 +
 ipatests/test_integration/tasks.py      | 11 ++++-------
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py
index a272143d0053451c017c0df613951cc0e6d52c54..3292cbfdcfde7c96bc4b4d241e5aa8c20534d602 100644
--- a/ipaplatform/base/paths.py
+++ b/ipaplatform/base/paths.py
@@ -354,6 +354,5 @@ class BasePathNamespace(object):
     DB2BAK = '/usr/sbin/db2bak'
     KDCPROXY_CONFIG = '/etc/ipa/kdcproxy/kdcproxy.conf'
     CERTMONGER = '/usr/sbin/certmonger'
-    NETWORK_MANAGER_CONFIG_DIR = '/etc/NetworkManager/conf.d'
 
 path_namespace = BasePathNamespace
diff --git a/ipatests/test_integration/env_config.py b/ipatests/test_integration/env_config.py
index d16a3430d04968575583b84a945db4bc7f7b0e93..5c6fd4f7ef0366135ae5ee47e56e668513109fcf 100644
--- a/ipatests/test_integration/env_config.py
+++ b/ipatests/test_integration/env_config.py
@@ -33,6 +33,7 @@ from ipatests.test_integration.config import Config, Domain
 
 TESTHOST_PREFIX = 'TESTHOST_'
 
+IPATEST_NETWORK_MANAGER_CONFIG = '/etc/NetworkManager/conf.d/20-ipatest-unmanaged-resolv.conf'
 
 _SettingInfo = collections.namedtuple('Setting', 'name var_name default')
 _setting_infos = (
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index c9ecf2645183d5f368694d3446ddf2853de22a2a..355b38992616e364b959ba381c03015046edbda2 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -35,14 +35,13 @@ from ipaplatform.paths import paths
 from ipapython.dn import DN
 from ipapython.ipa_log_manager import log_mgr
 from ipatests.test_integration import util
-from ipatests.test_integration.env_config import env_to_script
+from ipatests.test_integration.env_config import (
+    env_to_script, IPATEST_NETWORK_MANAGER_CONFIG)
 from ipatests.test_integration.host import Host
 from ipalib.util import get_reverse_zone_default
 
 log = log_mgr.get_logger(__name__)
 
-IPATEST_NM_CONFIG = '20-ipatest-unmanaged-resolv.conf'
-
 
 def prepare_reverse_zone(host, ip):
     zone = get_reverse_zone_default(ip)
@@ -125,9 +124,8 @@ def modify_nm_resolv_conf_settings(host):
         return
 
     config = "[main]\ndns=none\n"
-    path = os.path.join(paths.NETWORK_MANAGER_CONFIG_DIR, IPATEST_NM_CONFIG)
 
-    host.put_file_contents(path, config)
+    host.put_file_contents(IPATEST_NETWORK_MANAGER_CONFIG, config)
     host.run_command(['systemctl', 'restart', 'NetworkManager'],
                      raiseonerr=False)
 
@@ -136,8 +134,7 @@ def undo_nm_resolv_conf_settings(host):
     if not host_service_active(host, 'NetworkManager'):
         return
 
-    path = os.path.join(paths.NETWORK_MANAGER_CONFIG_DIR, IPATEST_NM_CONFIG)
-    host.run_command(['rm', '-f', path], raiseonerr=False)
+    host.run_command(['rm', '-f', IPATEST_NETWORK_MANAGER_CONFIG], raiseonerr=False)
     host.run_command(['systemctl', 'restart', 'NetworkManager'],
                      raiseonerr=False)
 
-- 
2.6.1

From 52294d1ec92c4e8340273891b761bef9c22c65ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Tue, 6 Oct 2015 14:55:49 +0200
Subject: [PATCH] ipatests: remove the ipatests specific config from
 ipaplatform

Move the test only configuration for Network Manager entirely
into ipatests part of the tree.
---
 ipaplatform/base/paths.py               |  1 -
 ipatests/test_integration/env_config.py |  1 +
 ipatests/test_integration/tasks.py      | 11 ++++-------
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py
index 0d2c4c17769ef643ba2d6c9991d910cf6e00858d..d2fcd8c708c08069f469beb332bfc1b793a8e903 100644
--- a/ipaplatform/base/paths.py
+++ b/ipaplatform/base/paths.py
@@ -355,6 +355,5 @@ class BasePathNamespace(object):
     DB2BAK = '/usr/sbin/db2bak'
     KDCPROXY_CONFIG = '/etc/ipa/kdcproxy/kdcproxy.conf'
     CERTMONGER = '/usr/sbin/certmonger'
-    NETWORK_MANAGER_CONFIG_DIR = '/etc/NetworkManager/conf.d'
 
 path_namespace = BasePathNamespace
diff --git a/ipatests/test_integration/env_config.py b/ipatests/test_integration/env_config.py
index 96062bef30ec067faa644dc060af8531f5e899c9..82e412d39e41bd273ec8ae9c43481e93ba6e050e 100644
--- a/ipatests/test_integration/env_config.py
+++ b/ipatests/test_integration/env_config.py
@@ -35,6 +35,7 @@ from ipatests.test_integration.config import Config, Domain
 
 TESTHOST_PREFIX = 'TESTHOST_'
 
+IPATEST_NETWORK_MANAGER_CONFIG = '/etc/NetworkManager/conf.d/20-ipatest-unmanaged-resolv.conf'
 
 _SettingInfo = collections.namedtuple('Setting', 'name var_name default')
 _setting_infos = (
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 1911b17cb6705fd69aa934d210fb4eec9a0f4c1b..cfbdd948ff970705a4a4f1a3b0ed4fd2de419156 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -35,14 +35,13 @@ from ipaplatform.paths import paths
 from ipapython.dn import DN
 from ipapython.ipa_log_manager import log_mgr
 from ipatests.test_integration import util
-from ipatests.test_integration.env_config import env_to_script
+from ipatests.test_integration.env_config import (
+    env_to_script, IPATEST_NETWORK_MANAGER_CONFIG)
 from ipatests.test_integration.host import Host
 from ipalib.util import get_reverse_zone_default
 
 log = log_mgr.get_logger(__name__)
 
-IPATEST_NM_CONFIG = '20-ipatest-unmanaged-resolv.conf'
-
 
 def check_arguments_are(slice, instanceof):
     """
@@ -143,9 +142,8 @@ def modify_nm_resolv_conf_settings(host):
         return
 
     config = "[main]\ndns=none\n"
-    path = os.path.join(paths.NETWORK_MANAGER_CONFIG_DIR, IPATEST_NM_CONFIG)
 
-    host.put_file_contents(path, config)
+    host.put_file_contents(IPATEST_NETWORK_MANAGER_CONFIG, config)
     host.run_command(['systemctl', 'restart', 'NetworkManager'],
                      raiseonerr=False)
 
@@ -154,8 +152,7 @@ def undo_nm_resolv_conf_settings(host):
     if not host_service_active(host, 'NetworkManager'):
         return
 
-    path = os.path.join(paths.NETWORK_MANAGER_CONFIG_DIR, IPATEST_NM_CONFIG)
-    host.run_command(['rm', '-f', path], raiseonerr=False)
+    host.run_command(['rm', '-f', IPATEST_NETWORK_MANAGER_CONFIG], raiseonerr=False)
     host.run_command(['systemctl', 'restart', 'NetworkManager'],
                      raiseonerr=False)
 
-- 
2.6.1

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to