about summary refs log tree commit diff
path: root/src/settings/plugins/ibft/tests
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2018-08-24 11:00:09 +0200
committerSebastien Bacher <seb128@ubuntu.com>2018-08-24 11:06:47 +0200
commitb7db94545968c37886b7111d8c85f62eb063fbb4 (patch)
tree7c2aedd497b1fdcb26bf9d49f98cc63a530baf2e /src/settings/plugins/ibft/tests
parent9d5cdc3adde9e7e57bf5a0e754e563b6a9e8e513 (diff)
parentcaf1db9d6fbc056cc6c76a24574890f6c7895f3d (diff)
Import Debian changes 1.12.2-0ubuntu3
network-manager (1.12.2-0ubuntu3) cosmic; urgency=medium

  * debian/rules:
    - use --with-libnm-glib, the default reversed since that's a legacy
      library but we still need it for unity-control-center

network-manager (1.12.2-0ubuntu2) cosmic; urgency=medium

  * debian/patches/git-newglib-test.patch:
    - backport upstream commit to fix the tests with the new glib 

network-manager (1.12.2-0ubuntu1) cosmic; urgency=medium

  * New upstream version
  * d/p/libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch,
    d/p/e91f1a7d2a6b8400b6b331d5b72287dcb5164a39.patch,
    d/p/git_thunderbolt_connect.patch:
    - removed, those changes are in the new version
  * Backport Debian changes
  * Update symbols file for libnm0
  * Enable iwd support
  * Drop version requirements when oldstable ships a newer version
  * Drop dh_strip override, the dbgsym migration is done
  * Rebase patches
  * Make sure the example server.conf is actually installed
  * Update install path for plugins, it now includes a version number
  * Drop libnl3 build dependency.
    Upstream has copied the code directly from libnl3 for the few functions it
    needs with a few small modifications.
  * Drop libiw build dependency.
    Hasn't been needed for a long time and was simply a left over from older
    releases.
  * Bump Standards-Version to 4.1.5
  * Fix compile error due to NM_AVAILABLE_IN_1_12_2 macro (Closes: #905372)
Diffstat (limited to 'src/settings/plugins/ibft/tests')
-rw-r--r--src/settings/plugins/ibft/tests/meson.build17
-rw-r--r--src/settings/plugins/ibft/tests/test-ibft.c22
2 files changed, 29 insertions, 10 deletions
diff --git a/src/settings/plugins/ibft/tests/meson.build b/src/settings/plugins/ibft/tests/meson.build
new file mode 100644
index 00000000..59f49c31
--- /dev/null
+++ b/src/settings/plugins/ibft/tests/meson.build
@@ -0,0 +1,17 @@
+test_unit = 'test-ibft'
+
+test_ibft_dir = meson.current_source_dir()
+
+exe = executable(
+  test_unit,
+  test_unit + '.c',
+  dependencies: test_nm_dep,
+  c_args: nm_build_cflags,
+  link_with: libnms_ibft_core
+)
+
+test(
+  'ibft/' + test_unit,
+  test_script,
+  args: test_args + [exe.full_path()]
+)
diff --git a/src/settings/plugins/ibft/tests/test-ibft.c b/src/settings/plugins/ibft/tests/test-ibft.c
index 72d1a7db..5e46be2e 100644
--- a/src/settings/plugins/ibft/tests/test-ibft.c
+++ b/src/settings/plugins/ibft/tests/test-ibft.c
@@ -36,6 +36,8 @@
 
 #include "nm-test-utils-core.h"
 
+#define TEST_DIR       NM_BUILD_SRCDIR"/src/settings/plugins/ibft/tests"
+
 static GPtrArray *
 read_block (const char *iscsiadm_path, const char *expected_mac)
 {
@@ -78,7 +80,7 @@ test_read_ibft_dhcp (void)
 	const char *expected_mac_address = "00:33:21:98:b9:f1";
 	GPtrArray *block;
 
-	block = read_block (TEST_IBFT_DIR "/iscsiadm-test-dhcp", expected_mac_address);
+	block = read_block (TEST_DIR "/iscsiadm-test-dhcp", expected_mac_address);
 
 	connection = nms_ibft_reader_get_connection_from_block (block, &error);
 	g_assert_no_error (error);
@@ -125,7 +127,7 @@ test_read_ibft_static (void)
 	NMIPAddress *ip4_addr;
 	GPtrArray *block;
 
-	block = read_block (TEST_IBFT_DIR "/iscsiadm-test-static", expected_mac_address);
+	block = read_block (TEST_DIR "/iscsiadm-test-static", expected_mac_address);
 
 	connection = nms_ibft_reader_get_connection_from_block (block, &error);
 	g_assert_no_error (error);
@@ -181,7 +183,7 @@ test_read_ibft_malformed (gconstpointer user_data)
 
 	g_assert (g_file_test (iscsiadm_path, G_FILE_TEST_EXISTS));
 
-	g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*malformed iscsiadm record*");
+	NMTST_EXPECT_NM_WARN ("*malformed iscsiadm record*");
 
 	success = nms_ibft_reader_load_blocks (iscsiadm_path, &blocks, &error);
 	g_assert_no_error (error);
@@ -227,7 +229,7 @@ test_read_ibft_vlan (void)
 	GError *error = NULL;
 	GPtrArray *block;
 
-	block = read_block (TEST_IBFT_DIR "/iscsiadm-test-vlan", expected_mac_address);
+	block = read_block (TEST_DIR "/iscsiadm-test-vlan", expected_mac_address);
 
 	connection = nms_ibft_reader_get_connection_from_block (block, &error);
 	g_assert_no_error (error);
@@ -280,12 +282,12 @@ int main (int argc, char **argv)
 	g_test_add_func (TPATH "ibft/dhcp", test_read_ibft_dhcp);
 	g_test_add_func (TPATH "ibft/static", test_read_ibft_static);
 	g_test_add_func (TPATH "ibft/vlan", test_read_ibft_vlan);
-	g_test_add_data_func (TPATH "ibft/bad-record-read", TEST_IBFT_DIR "/iscsiadm-test-bad-record", test_read_ibft_malformed);
-	g_test_add_data_func (TPATH "ibft/bad-entry-read", TEST_IBFT_DIR "/iscsiadm-test-bad-entry", test_read_ibft_malformed);
-	g_test_add_data_func (TPATH "ibft/bad-ipaddr-read", TEST_IBFT_DIR "/iscsiadm-test-bad-ipaddr", test_read_ibft_bad_address);
-	g_test_add_data_func (TPATH "ibft/bad-gateway-read", TEST_IBFT_DIR "/iscsiadm-test-bad-gateway", test_read_ibft_bad_address);
-	g_test_add_data_func (TPATH "ibft/bad-dns1-read", TEST_IBFT_DIR "/iscsiadm-test-bad-dns1", test_read_ibft_bad_address);
-	g_test_add_data_func (TPATH "ibft/bad-dns2-read", TEST_IBFT_DIR "/iscsiadm-test-bad-dns2", test_read_ibft_bad_address);
+	g_test_add_data_func (TPATH "ibft/bad-record-read", TEST_DIR "/iscsiadm-test-bad-record", test_read_ibft_malformed);
+	g_test_add_data_func (TPATH "ibft/bad-entry-read", TEST_DIR "/iscsiadm-test-bad-entry", test_read_ibft_malformed);
+	g_test_add_data_func (TPATH "ibft/bad-ipaddr-read", TEST_DIR "/iscsiadm-test-bad-ipaddr", test_read_ibft_bad_address);
+	g_test_add_data_func (TPATH "ibft/bad-gateway-read", TEST_DIR "/iscsiadm-test-bad-gateway", test_read_ibft_bad_address);
+	g_test_add_data_func (TPATH "ibft/bad-dns1-read", TEST_DIR "/iscsiadm-test-bad-dns1", test_read_ibft_bad_address);
+	g_test_add_data_func (TPATH "ibft/bad-dns2-read", TEST_DIR "/iscsiadm-test-bad-dns2", test_read_ibft_bad_address);
 
 	return g_test_run ();
 }