summary refs log tree commit diff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-test-utils-impl.c2
-rw-r--r--shared/nm-utils/nm-test-utils.h27
-rw-r--r--shared/nm-version-macros.h3
-rw-r--r--shared/nm-version-macros.h.in1
4 files changed, 21 insertions, 12 deletions
diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c
index 3add88c7..9e7312ca 100644
--- a/shared/nm-test-utils-impl.c
+++ b/shared/nm-test-utils-impl.c
@@ -164,7 +164,7 @@ nmtstc_service_init (void)
 		g_source_set_callback (child_source, (GSourceFunc)(void (*) (void)) _service_init_wait_child_wait, &data, NULL);
 		g_source_attach (child_source, context);
 
-		had_timeout = !nmtst_main_loop_run (data.mainloop, 3000);
+		had_timeout = !nmtst_main_loop_run (data.mainloop, 30000);
 
 		g_source_destroy (timeout_source);
 		g_source_destroy (child_source);
diff --git a/shared/nm-utils/nm-test-utils.h b/shared/nm-utils/nm-test-utils.h
index efb41454..743893f0 100644
--- a/shared/nm-utils/nm-test-utils.h
+++ b/shared/nm-utils/nm-test-utils.h
@@ -43,9 +43,10 @@
  *   and g_test_assert_expected_messages() will not fail.
  *
  * NMTST_SEED_RAND environment variable:
- *   Tests that use random numbers from nmtst_get_rand() get seeded randomly at each start.
- *   You can specify the seed by setting NMTST_SEED_RAND. Also, tests will print the seed
- *   to stdout, so that you know the chosen seed.
+ *   Tests that use random numbers from nmtst_get_rand() get seeded at each start.
+ *   You can specify the seed by setting NMTST_SEED_RAND to a particular number or empty ("")
+ *   for a random one. If NMTST_SEED_RAND is not set (default) a stable seed gets chosen.
+ *   Tests will print the seed to stdout, so that you know which one was chosen or generated.
  *
  *
  * NMTST_DEBUG environment variable:
@@ -790,9 +791,20 @@ nmtst_get_rand (void)
 
 	if (G_UNLIKELY (!__nmtst_internal.rand)) {
 		guint32 seed;
-		const char *str;
+		const char *str = g_getenv ("NMTST_SEED_RAND");
 
-		if ((str = g_getenv ("NMTST_SEED_RAND"))) {
+		if (!str) {
+			/* No NMTST_SEED_RAND. Pick a stable one. */
+			seed = 0;
+			__nmtst_internal.rand = g_rand_new_with_seed (seed);
+		} else if (str[0] == '\0') {
+			/* NMTST_SEED_RAND is set but empty. Pick a random one. */
+			__nmtst_internal.rand = g_rand_new ();
+
+			seed = g_rand_int (__nmtst_internal.rand);
+			g_rand_set_seed (__nmtst_internal.rand, seed);
+		} else {
+			/* NMTST_SEED_RAND is set. Use it as a seed. */
 			gchar *s;
 			gint64 i;
 
@@ -801,11 +813,6 @@ nmtst_get_rand (void)
 
 			seed = i;
 			__nmtst_internal.rand = g_rand_new_with_seed (seed);
-		} else {
-			__nmtst_internal.rand = g_rand_new ();
-
-			seed = g_rand_int (__nmtst_internal.rand);
-			g_rand_set_seed (__nmtst_internal.rand, seed);
 		}
 		__nmtst_internal.rand_seed = seed;
 
diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h
index 06936567..350858e2 100644
--- a/shared/nm-version-macros.h
+++ b/shared/nm-version-macros.h
@@ -45,7 +45,7 @@
  * Evaluates to the micro version number of NetworkManager which this source
  * compiled against.
  */
-#define NM_MICRO_VERSION (0)
+#define NM_MICRO_VERSION (2)
 
 /**
  * NM_CHECK_VERSION:
@@ -73,6 +73,7 @@
 #define NM_VERSION_1_8    (NM_ENCODE_VERSION (1, 8, 0))
 #define NM_VERSION_1_10   (NM_ENCODE_VERSION (1, 10, 0))
 #define NM_VERSION_1_12   (NM_ENCODE_VERSION (1, 12, 0))
+#define NM_VERSION_1_12_2 (NM_ENCODE_VERSION (1, 12, 2))
 
 /* For releases, NM_API_VERSION is equal to NM_VERSION.
  *
diff --git a/shared/nm-version-macros.h.in b/shared/nm-version-macros.h.in
index 8d07fc82..0d8fa87a 100644
--- a/shared/nm-version-macros.h.in
+++ b/shared/nm-version-macros.h.in
@@ -73,6 +73,7 @@
 #define NM_VERSION_1_8    (NM_ENCODE_VERSION (1, 8, 0))
 #define NM_VERSION_1_10   (NM_ENCODE_VERSION (1, 10, 0))
 #define NM_VERSION_1_12   (NM_ENCODE_VERSION (1, 12, 0))
+#define NM_VERSION_1_12_2 (NM_ENCODE_VERSION (1, 12, 2))
 
 /* For releases, NM_API_VERSION is equal to NM_VERSION.
  *