summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-12-08 17:28:51 -0800
committerDan Williams <dcbw@redhat.com>2009-12-08 17:28:51 -0800
commitcbe313b4479e09b9e0cbd3fb9e865f3f4d6843c3 (patch)
tree0cf950746e0f701a4a18dfafe8eca144a8088aea
parent4274edf47dfc1341704311d9587dc6951db480e9 (diff)
ifcfg-rh: fix distcheck and tests after 9e93924cca6c9f5f7fc6819babd9dd2771c1cc030.8-rc1
Since one test read in a file, wrote it out, and read it in again, we have to be careful of whether srcdir == builddir or not. If it doesn't, then we need to remove the written-out connection file. If it does, then we don't want to remove that written-out connection file because it's tracked by SCM. Avoid the whole problem by writing it out to a separate directory that we can always delete it from.
-rw-r--r--system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am3
-rw-r--r--system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
index 0d9fee967b..80a4054a2d 100644
--- a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
+++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
@@ -55,3 +55,6 @@ check-local:
chmod 0600 $(abs_srcdir)/$$f; \
done
+# Make the special temp dir for some written connections
+ mkdir -p $(abs_builddir)/tmp
+
diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index 3241ebbd98..1d3b8d44a7 100644
--- a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -4343,9 +4343,12 @@ test_read_write_static_routes_legacy (void)
NM_SETTING_IP4_CONFIG_SETTING_NAME,
NM_SETTING_IP4_CONFIG_NEVER_DEFAULT);
- /* Save the ifcfg */
+ /* Save the ifcfg; use a special different scratch dir to ensure that
+ * we can clean up after the written connection in both the original
+ * source tree and for 'make distcheck'.
+ */
success = writer_new_connection (connection,
- TEST_SCRATCH_DIR "/network-scripts/",
+ TEST_SCRATCH_DIR "/network-scripts/tmp",
&testfile,
&error);
ASSERT (success == TRUE,