ifcfg-rh: fix distcheck and tests after 9e93924cca

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.
This commit is contained in:
Dan Williams 2009-12-08 17:28:51 -08:00
parent 4274edf47d
commit cbe313b447
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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,