From b36fdfe7a14d09b69998344993631af0a5b942c6 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 8 Sep 2015 13:23:47 +0200 Subject: [PATCH] Add missing patch --- 0001-test-fix-duplicate-test-names.patch | 283 +++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 0001-test-fix-duplicate-test-names.patch diff --git a/0001-test-fix-duplicate-test-names.patch b/0001-test-fix-duplicate-test-names.patch new file mode 100644 index 0000000..4e37c94 --- /dev/null +++ b/0001-test-fix-duplicate-test-names.patch @@ -0,0 +1,283 @@ +From 12af09b779d70979516529c63633b7d296f82b47 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 3 Sep 2015 18:15:46 +0200 +Subject: [PATCH 1/2] test: fix duplicate test names + +New glib complains. + +(cherry picked from commit 874f455d6d47c5a34ed9861a6710f4b78202e0d6) +--- + libnm-core/tests/test-general.c | 20 +-- + src/devices/wifi/tests/test-wifi-ap-utils.c | 137 +++++++-------------- + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 14 +-- + 3 files changed, 62 insertions(+), 109 deletions(-) + +diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c +index e948365..a73604b 100644 +--- a/libnm-core/tests/test-general.c ++++ b/libnm-core/tests/test-general.c +@@ -4637,18 +4637,18 @@ int main (int argc, char **argv) + g_test_add_func ("/core/general/test_setting_to_dbus_enum", test_setting_to_dbus_enum); + g_test_add_func ("/core/general/test_setting_compare_id", test_setting_compare_id); + g_test_add_func ("/core/general/test_setting_compare_timestamp", test_setting_compare_timestamp); +-#define ADD_FUNC(func, secret_flags, comp_flags, remove_secret) \ +- g_test_add_data_func_full ("/core/general/" G_STRINGIFY (func), \ ++#define ADD_FUNC(name, func, secret_flags, comp_flags, remove_secret) \ ++ g_test_add_data_func_full ("/core/general/" G_STRINGIFY (func) "_" name, \ + test_data_compare_secrets_new (secret_flags, comp_flags, remove_secret), \ + func, g_free) +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); ++ ADD_FUNC ("agent_owned", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); ++ ADD_FUNC ("not_saved", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); ++ ADD_FUNC ("secrets", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); ++ ADD_FUNC ("exact", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); ++ ADD_FUNC ("agent_owned", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); ++ ADD_FUNC ("not_saved", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); ++ ADD_FUNC ("secrets", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); ++ ADD_FUNC ("exact", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); + g_test_add_func ("/core/general/test_setting_old_uuid", test_setting_old_uuid); + + g_test_add_func ("/core/general/test_connection_to_dbus_setting_name", test_connection_to_dbus_setting_name); +diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c +index 3c405e2..a5dc545 100644 +--- a/src/devices/wifi/tests/test-wifi-ap-utils.c ++++ b/src/devices/wifi/tests/test-wifi-ap-utils.c +@@ -1364,10 +1364,10 @@ main (int argc, char **argv) + test_open_ap_leap_connection_1); + g_test_add_func ("/wifi/open_ap/leap_connection/2", + test_open_ap_leap_connection_2); +- g_test_add_data_func ("/wifi/open_ap/wep_connection", ++ g_test_add_data_func ("/wifi/open_ap/wep_connection_true", + (gconstpointer) TRUE, + test_open_ap_wep_connection); +- g_test_add_data_func ("/wifi/open_ap/wep_connection", ++ g_test_add_data_func ("/wifi/open_ap/wep_connection_false", + (gconstpointer) FALSE, + test_open_ap_wep_connection); + +@@ -1441,104 +1441,57 @@ main (int argc, char **argv) + (gconstpointer) IDX_PRIV, + test_ap_wpa_eap_connection_5); + ++#define ADD_FUNC(func) do { \ ++ gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ g_test_add_data_func (name_idx, (gconstpointer) i, func); \ ++ g_free (name_idx); \ ++ } while (0) ++ + /* WPA-PSK tests */ + for (i = IDX_WPA_PSK_PTKIP_GTKIP; i <= IDX_WPA_RSN_PSK_PCCMP_GCCMP; i++) { +- g_test_add_data_func ("/wifi/wpa_psk/empty_connection", +- (gconstpointer) i, +- test_wpa_ap_empty_connection); +- g_test_add_data_func ("/wifi/wpa_psk/leap_connection/1", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/leap_connection/2", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_2); +- +- g_test_add_data_func ("/wifi/wpa_psk/dynamic_wep_connection", +- (gconstpointer) i, +- test_wpa_ap_dynamic_wep_connection); +- +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/1", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/2", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_2); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/3", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_3); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/4", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_4); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/5", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_5); +- +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/1", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/2", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_2); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/3", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_3); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/4", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_4); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/5", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_5); ++ ADD_FUNC(test_wpa_ap_empty_connection); ++ ADD_FUNC(test_wpa_ap_leap_connection_1); ++ ADD_FUNC(test_wpa_ap_leap_connection_2); ++ ADD_FUNC(test_wpa_ap_dynamic_wep_connection); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); ++ ADD_FUNC(test_ap_wpa_eap_connection_1); ++ ADD_FUNC(test_ap_wpa_eap_connection_2); ++ ADD_FUNC(test_ap_wpa_eap_connection_3); ++ ADD_FUNC(test_ap_wpa_eap_connection_4); ++ ADD_FUNC(test_ap_wpa_eap_connection_5); + } + ++#undef ADD_FUNC ++#define ADD_FUNC(func) do { \ ++ gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ g_test_add_data_func (name_idx, (gconstpointer) i, func); \ ++ g_free (name_idx); \ ++ } while (0) ++ + /* RSN-PSK tests */ + for (i = IDX_WPA_RSN_PSK_PTKIP_PCCMP_GTKIP; i <= IDX_RSN_PSK_PTKIP_PCCMP_GTKIP; i++) { +- g_test_add_data_func ("/wifi/rsn_psk/empty_connection", +- (gconstpointer) i, +- test_wpa_ap_empty_connection); +- g_test_add_data_func ("/wifi/rsn_psk/leap_connection/1", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/leap_connection/2", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_2); +- +- g_test_add_data_func ("/wifi/rsn_psk/dynamic_wep_connection", +- (gconstpointer) i, +- test_wpa_ap_dynamic_wep_connection); +- +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/1", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/2", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_2); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/3", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_3); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/4", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_4); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/5", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_5); +- +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/1", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/2", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_2); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/3", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_3); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/4", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_4); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/5", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_5); ++ ADD_FUNC(test_wpa_ap_empty_connection); ++ ADD_FUNC(test_wpa_ap_leap_connection_1); ++ ADD_FUNC(test_wpa_ap_leap_connection_2); ++ ADD_FUNC(test_wpa_ap_dynamic_wep_connection); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); ++ ADD_FUNC(test_ap_wpa_eap_connection_1); ++ ADD_FUNC(test_ap_wpa_eap_connection_2); ++ ADD_FUNC(test_ap_wpa_eap_connection_3); ++ ADD_FUNC(test_ap_wpa_eap_connection_4); ++ ADD_FUNC(test_ap_wpa_eap_connection_5); + } + ++#undef ADD_FUNC ++ + /* Scanned signal strength conversion tests */ + g_test_add_func ("/wifi/strength/dbm", + test_strength_dbm); +diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +index f2f85d3..953b0c7 100644 +--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c ++++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +@@ -12604,12 +12604,12 @@ int main (int argc, char **argv) + test_read_wired_static (TEST_IFCFG_WIRED_STATIC, "System test-wired-static", TRUE); + test_read_wired_static (TEST_IFCFG_WIRED_STATIC_BOOTPROTO, "System test-wired-static-bootproto", FALSE); + test_read_wired_dhcp (); +- g_test_add_func (TPATH "dhcp-plus-ip", test_read_wired_dhcp_plus_ip); +- g_test_add_func (TPATH "shared-plus-ip", test_read_wired_shared_plus_ip); +- g_test_add_func (TPATH "dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname); +- g_test_add_func (TPATH "global-gateway", test_read_wired_global_gateway); +- g_test_add_func (TPATH "obsolete-gateway-n", test_read_wired_obsolete_gateway_n); +- g_test_add_func (TPATH "never-default", test_read_wired_never_default); ++ g_test_add_func (TPATH "read-dhcp-plus-ip", test_read_wired_dhcp_plus_ip); ++ g_test_add_func (TPATH "read-shared-plus-ip", test_read_wired_shared_plus_ip); ++ g_test_add_func (TPATH "read-dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname); ++ g_test_add_func (TPATH "read-global-gateway", test_read_wired_global_gateway); ++ g_test_add_func (TPATH "read-obsolete-gateway-n", test_read_wired_obsolete_gateway_n); ++ g_test_add_func (TPATH "read-never-default", test_read_wired_never_default); + test_read_wired_defroute_no (); + test_read_wired_defroute_no_gatewaydev_yes (); + g_test_add_func (TPATH "routes/read-static", test_read_wired_static_routes); +@@ -12679,7 +12679,7 @@ int main (int argc, char **argv) + test_write_wired_static_routes (); + test_read_write_static_routes_legacy (); + test_write_wired_dhcp (); +- g_test_add_func (TPATH "dhcp-plus-ip", test_write_wired_dhcp_plus_ip); ++ g_test_add_func (TPATH "wired/write-dhcp-plus-ip", test_write_wired_dhcp_plus_ip); + test_write_wired_dhcp_8021x_peap_mschapv2 (); + test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_PATH, NM_SETTING_SECRET_FLAG_AGENT_OWNED); + test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_PATH, NM_SETTING_SECRET_FLAG_NOT_SAVED); +-- +2.4.3 + +From 317b6cb880b6afbb11a6578bc3791cb6eba5f2e7 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 4 Sep 2015 12:49:54 +0200 +Subject: [PATCH 2/2] tests: fix 32-bit build + +Fixes: 874f455d6d47c5a34ed9861a6710f4b78202e0d6 +(cherry picked from commit f71f9d5fcf5726f9be5ac0c97e7dbc26c3e57ecc) +--- + src/devices/wifi/tests/test-wifi-ap-utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c +index a5dc545..26e130c 100644 +--- a/src/devices/wifi/tests/test-wifi-ap-utils.c ++++ b/src/devices/wifi/tests/test-wifi-ap-utils.c +@@ -1442,7 +1442,7 @@ main (int argc, char **argv) + test_ap_wpa_eap_connection_5); + + #define ADD_FUNC(func) do { \ +- gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) +@@ -1467,7 +1467,7 @@ main (int argc, char **argv) + + #undef ADD_FUNC + #define ADD_FUNC(func) do { \ +- gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) +-- +2.4.3 +