ifcfg/tests: fix evaluating environment variable to regenerate test files

Fixes: 1ae6719cf1 ('ifcfg-rh/tests: evalute environment for $NMTST_IFCFG_RH_UPDATE_EXPECTED only once')
(cherry picked from commit 02832b03ee)
This commit is contained in:
Thomas Haller 2021-08-17 09:49:58 +02:00 committed by Beniamino Galvani
parent 722c7805e4
commit 3f9958451f

View file

@ -188,8 +188,8 @@ _assert_expected_content(NMConnection *connection, const char *filename, const c
if (G_UNLIKELY(rewrite == 0)) {
rewrite = (g_getenv("NMTST_IFCFG_RH_UPDATE_EXPECTED")
|| nm_streq0(g_getenv("NM_TEST_REGENERATE"), "1"))
? -1
: 1;
? 1
: -1;
if (!g_atomic_int_compare_and_exchange(&rewrite_static, 0, rewrite))
g_assert_not_reached();
}