Blame slurm_fix_testsuite.patch

Philip Kovacs b8cc3a
commit 7fa8a69d8eda68ac1fa144de7686e47d18161037
Philip Kovacs b8cc3a
Author: Philip Kovacs <pkdevel@yahoo.com>
Philip Kovacs b8cc3a
Date:   Fri Jun 7 07:33:01 2019 -0600
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
    patch for 19.05.0 testsuite `make check` errors
Philip Kovacs b8cc3a
    
Philip Kovacs b8cc3a
    bug 7197
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c b/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
index 2f245622e7..ca95f636a8 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
@@ -59,7 +59,7 @@ START_TEST(pack_1702_req_null_ptrs)
Philip Kovacs b8cc3a
 	unpack_req = (job_alloc_info_msg_t *)msg.data;
Philip Kovacs b8cc3a
 	ck_assert_int_eq(rc, SLURM_SUCCESS);
Philip Kovacs b8cc3a
 	ck_assert(unpack_req);
Philip Kovacs b8cc3a
-	ck_assert(!unpack_req->req_cluster); /* >= 17.11 */
Philip Kovacs b8cc3a
+	//ck_assert(!unpack_req->req_cluster); /* >= 17.11 */
Philip Kovacs b8cc3a
 	ck_assert_uint_eq(unpack_req->job_id, pack_req.job_id);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
@@ -94,7 +94,7 @@ START_TEST(pack_1702_req)
Philip Kovacs b8cc3a
 	unpack_req = (job_alloc_info_msg_t *)msg.data;
Philip Kovacs b8cc3a
 	ck_assert_int_eq(rc, SLURM_SUCCESS);
Philip Kovacs b8cc3a
 	ck_assert(unpack_req);
Philip Kovacs b8cc3a
-	ck_assert(!unpack_req->req_cluster); /* >= 17.11 */
Philip Kovacs b8cc3a
+	//ck_assert(!unpack_req->req_cluster); /* >= 17.11 */
Philip Kovacs b8cc3a
 	ck_assert_uint_eq(unpack_req->job_id, pack_req.job_id);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
index dd10e1b857..d068fef66d 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
@@ -236,9 +236,9 @@ Suite* suite(void)
Philip Kovacs b8cc3a
 	TCase* tc_core = tcase_create("Pack slurmdb_federation_rec_t");
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, invalid_protocol);
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1702_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_null_federation_rec);
Philip Kovacs b8cc3a
+	//tcase_add_test(tc_core, pack_1702_null_federation_rec);
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1702_federation_rec_empty_list);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_federation_rec_fail);
Philip Kovacs b8cc3a
+	//tcase_add_test(tc_core, pack_1702_federation_rec_fail);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1711_federation_rec);
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1711_null_federation_rec);
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/xhash-test.c b/testsuite/slurm_unit/common/xhash-test.c
Philip Kovacs b8cc3a
index 46616aef2b..2fc4d1d373 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/xhash-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/xhash-test.c
Philip Kovacs b8cc3a
@@ -49,12 +49,11 @@ typedef struct hashable_st {
Philip Kovacs b8cc3a
 	uint32_t idn;
Philip Kovacs b8cc3a
 } hashable_t;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-const char* hashable_identify(void* voiditem)
Philip Kovacs b8cc3a
+void hashable_identify(void* voiditem, const char** key, uint32_t* key_len)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	hashable_t* item = (hashable_t*)voiditem;
Philip Kovacs b8cc3a
-	if (!item->id[0]) snprintf(item->id, 255, "%lu",
Philip Kovacs b8cc3a
-			(unsigned long)item->idn);
Philip Kovacs b8cc3a
-	return item->id;
Philip Kovacs b8cc3a
+	*key = item->id;
Philip Kovacs b8cc3a
+	*key_len = strlen(item->id);
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 /*****************************************************************************
Philip Kovacs b8cc3a
@@ -71,7 +70,7 @@ static void setup(void)
Philip Kovacs b8cc3a
 	g_ht = xhash_init(hashable_identify, NULL);
Philip Kovacs b8cc3a
 	if (!g_ht) return; /* fatal error, will be detected by test cases */
Philip Kovacs b8cc3a
 	for (i = 0; i < g_hashableslen; ++i) {
Philip Kovacs b8cc3a
-		g_hashables[i].id[0] = 0;
Philip Kovacs b8cc3a
+		snprintf(g_hashables[i].id, sizeof(g_hashables[i].id), "%d", i);
Philip Kovacs b8cc3a
 		g_hashables[i].idn = i;
Philip Kovacs b8cc3a
 		/* it is an error if xhash_add returns null but it will be
Philip Kovacs b8cc3a
 		 * detected by test cases */
Philip Kovacs b8cc3a
@@ -120,7 +119,7 @@ START_TEST(test_add)
Philip Kovacs b8cc3a
 	fail_unless(xhash_add(ht, a+3) != NULL, "xhash_add failed");
Philip Kovacs b8cc3a
 	for (i = 0; i < len; ++i) {
Philip Kovacs b8cc3a
 		snprintf(buffer, sizeof(buffer), "%d", i);
Philip Kovacs b8cc3a
-		fail_unless(xhash_get(ht, buffer) == (a + i),
Philip Kovacs b8cc3a
+		fail_unless(xhash_get_str(ht, buffer) == (a + i),
Philip Kovacs b8cc3a
 				"bad hashable item returned");
Philip Kovacs b8cc3a
 	}
Philip Kovacs b8cc3a
 	xhash_free(ht);
Philip Kovacs b8cc3a
@@ -134,14 +133,14 @@ START_TEST(test_find)
Philip Kovacs b8cc3a
 	int i;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* test bad match */
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "bad") == NULL  , "invalid case not null");
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "-1") == NULL   , "invalid case not null");
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "10000") == NULL, "invalid case not null");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "bad") == NULL  , "invalid case not null");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "-1") == NULL   , "invalid case not null");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "10000") == NULL, "invalid case not null");
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* test all good indexes */
Philip Kovacs b8cc3a
 	for (i = 0; i < g_hashableslen; ++i) {
Philip Kovacs b8cc3a
 		snprintf(buffer, sizeof(buffer), "%d", i);
Philip Kovacs b8cc3a
-		fail_unless(xhash_get(ht, buffer) == (g_hashables + i),
Philip Kovacs b8cc3a
+		fail_unless(xhash_get_str(ht, buffer) == (g_hashables + i),
Philip Kovacs b8cc3a
 				"bad hashable item returned");
Philip Kovacs b8cc3a
 	}
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
@@ -156,7 +155,7 @@ static int test_delete_helper()
Philip Kovacs b8cc3a
 	char buffer[255];
Philip Kovacs b8cc3a
 	for (i = 0; i < g_hashableslen; ++i) {
Philip Kovacs b8cc3a
 		snprintf(buffer, sizeof(buffer), "%d", i);
Philip Kovacs b8cc3a
-		if (xhash_get(ht, buffer) != (g_hashables + i)) {
Philip Kovacs b8cc3a
+		if (xhash_get_str(ht, buffer) != (g_hashables + i)) {
Philip Kovacs b8cc3a
 			++ret;
Philip Kovacs b8cc3a
 		}
Philip Kovacs b8cc3a
 	}
Philip Kovacs b8cc3a
@@ -170,10 +169,10 @@ START_TEST(test_delete)
Philip Kovacs b8cc3a
 	char buffer[255];
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* invalid cases */
Philip Kovacs b8cc3a
-	xhash_delete(NULL, "1");
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "1") != NULL, "invalid case null");
Philip Kovacs b8cc3a
+	xhash_delete_str(NULL, "1");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "1") != NULL, "invalid case null");
Philip Kovacs b8cc3a
 	/* Deleting non-existent item should do nothing. */
Philip Kovacs b8cc3a
-	xhash_delete(ht, NULL);
Philip Kovacs b8cc3a
+	xhash_delete(ht, NULL, 0);
Philip Kovacs b8cc3a
 	fail_unless(xhash_count(ht) == g_hashableslen,
Philip Kovacs b8cc3a
 			"invalid delete has been done");
Philip Kovacs b8cc3a
 	result = test_delete_helper();
Philip Kovacs b8cc3a
@@ -182,17 +181,17 @@ START_TEST(test_delete)
Philip Kovacs b8cc3a
 			result);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* test correct deletion */
Philip Kovacs b8cc3a
-	xhash_delete(ht, "10");
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "10") == NULL, "item not deleted");
Philip Kovacs b8cc3a
+	xhash_delete_str(ht, "10");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "10") == NULL, "item not deleted");
Philip Kovacs b8cc3a
 	fail_unless(xhash_count(ht) == (g_hashableslen-1), "bad count");
Philip Kovacs b8cc3a
 	/* left edge */
Philip Kovacs b8cc3a
-	xhash_delete(ht, "0");
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "0") == NULL, "item not deleted");
Philip Kovacs b8cc3a
+	xhash_delete_str(ht, "0");
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "0") == NULL, "item not deleted");
Philip Kovacs b8cc3a
 	fail_unless(xhash_count(ht) == (g_hashableslen-2), "bad count");
Philip Kovacs b8cc3a
 	/* right edge */
Philip Kovacs b8cc3a
 	snprintf(buffer, sizeof(buffer), "%u", (g_hashableslen-2));
Philip Kovacs b8cc3a
-	xhash_delete(ht, buffer);
Philip Kovacs b8cc3a
-	fail_unless(xhash_get(ht, "0") == NULL, "item not deleted");
Philip Kovacs b8cc3a
+	xhash_delete_str(ht, buffer);
Philip Kovacs b8cc3a
+	fail_unless(xhash_get_str(ht, "0") == NULL, "item not deleted");
Philip Kovacs b8cc3a
 	fail_unless(xhash_count(ht) == (g_hashableslen-3), "bad count");
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	result = test_delete_helper();
Philip Kovacs b8cc3a
commit b0db3f0fbfdfc9a7820f24c4b30adee696dc863a
Philip Kovacs b8cc3a
Author: Morris Jette <jette@schedmd.com>
Philip Kovacs b8cc3a
Date:   Fri Jun 7 07:57:26 2019 -0600
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
    Modify "make check" to validate v1808 un/pack logic
Philip Kovacs b8cc3a
    
Philip Kovacs b8cc3a
    bug 7197
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
index d068fef66d..bbeeefc4a7 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
@@ -32,29 +32,26 @@ START_TEST(invalid_protocol)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_null_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_1711_null_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
-	slurmdb_federation_rec_t pack_fr = {0};
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	slurmdb_pack_federation_rec(NULL, SLURM_MIN_PROTOCOL_VERSION, buf);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	set_buf_offset(buf, 0);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	slurmdb_federation_rec_t *unpack_fr;
Philip Kovacs b8cc3a
+	slurmdb_federation_rec_t *unpack_fr = NULL;
Philip Kovacs b8cc3a
 	rc = slurmdb_unpack_federation_rec((void **)&unpack_fr, SLURM_MIN_PROTOCOL_VERSION, buf);
Philip Kovacs b8cc3a
-	ck_assert(rc                   == SLURM_SUCCESS);
Philip Kovacs b8cc3a
-	ck_assert(pack_fr.name         == unpack_fr->name);
Philip Kovacs b8cc3a
-	ck_assert(pack_fr.flags        == unpack_fr->flags);
Philip Kovacs b8cc3a
-	ck_assert(pack_fr.cluster_list == unpack_fr->cluster_list);
Philip Kovacs b8cc3a
+	ck_assert(rc        == SLURM_SUCCESS);
Philip Kovacs b8cc3a
+	ck_assert(unpack_fr == NULL);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
 	slurmdb_destroy_federation_rec(unpack_fr);
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_1711_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -90,7 +87,7 @@ START_TEST(pack_1702_federation_rec)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_federation_rec_empty_list)
Philip Kovacs b8cc3a
+START_TEST(pack_1711_federation_rec_empty_list)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -118,31 +115,7 @@ START_TEST(pack_1702_federation_rec_empty_list)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-/* This test sets up the buffer so that it fails when unpacking the cluster rec.
Philip Kovacs b8cc3a
- */
Philip Kovacs b8cc3a
-START_TEST(pack_1702_federation_rec_fail)
Philip Kovacs b8cc3a
-{
Philip Kovacs b8cc3a
-	int rc;
Philip Kovacs b8cc3a
-	char *name = xstrdup("Saint Augustine");
Philip Kovacs b8cc3a
-	Buf buf = init_buf(18*sizeof(uint32_t));
Philip Kovacs b8cc3a
-	packstr(name, buf);
Philip Kovacs b8cc3a
-	pack32(7, buf);
Philip Kovacs b8cc3a
-	pack32(1, buf);
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
-	set_buf_offset(buf, 0);
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
-	slurmdb_federation_rec_t *unpack_fr;
Philip Kovacs b8cc3a
-	rc = slurmdb_unpack_federation_rec((void **)&unpack_fr, SLURM_MIN_PROTOCOL_VERSION, buf);
Philip Kovacs b8cc3a
-	ck_assert_int_eq(rc, SLURM_ERROR);
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
-	free_buf(buf);
Philip Kovacs b8cc3a
-	xfree(name);
Philip Kovacs b8cc3a
-}
Philip Kovacs b8cc3a
-END_TEST
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
-/* 17.11 */
Philip Kovacs b8cc3a
-START_TEST(pack_1711_null_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_1808_null_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -161,7 +134,7 @@ START_TEST(pack_1711_null_federation_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_1808_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -197,7 +170,7 @@ START_TEST(pack_1711_federation_rec)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_federation_rec_empty_list)
Philip Kovacs b8cc3a
+START_TEST(pack_1808_federation_rec_empty_list)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -235,15 +208,14 @@ Suite* suite(void)
Philip Kovacs b8cc3a
 	Suite* s = suite_create("Pack slurmdb_federation_rec_t");
Philip Kovacs b8cc3a
 	TCase* tc_core = tcase_create("Pack slurmdb_federation_rec_t");
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, invalid_protocol);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_federation_rec);
Philip Kovacs b8cc3a
-	//tcase_add_test(tc_core, pack_1702_null_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_federation_rec_empty_list);
Philip Kovacs b8cc3a
-	//tcase_add_test(tc_core, pack_1702_federation_rec_fail);
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1711_federation_rec);
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1711_null_federation_rec);
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, pack_1711_federation_rec_empty_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_1808_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_1808_null_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_1808_federation_rec_empty_list);
Philip Kovacs b8cc3a
+
Philip Kovacs b8cc3a
 	suite_add_tcase(s, tc_core);
Philip Kovacs b8cc3a
 	return s;
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
commit 8aade6d1a3b25ee43b466f7c5624f5199b7bf0ec
Philip Kovacs b8cc3a
Author: Morris Jette <jette@schedmd.com>
Philip Kovacs b8cc3a
Date:   Fri Jun 7 08:14:50 2019 -0600
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
    Rename some "make check" functions names to be generic
Philip Kovacs b8cc3a
    
Philip Kovacs b8cc3a
    bug 7197
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
index bbeeefc4a7..6a48164027 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurmdb_pack/pack_federation_rec-test.c
Philip Kovacs b8cc3a
@@ -32,7 +32,7 @@ START_TEST(invalid_protocol)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_null_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_null_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -51,7 +51,7 @@ START_TEST(pack_1711_null_federation_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -87,7 +87,7 @@ START_TEST(pack_1711_federation_rec)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_federation_rec_empty_list)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_federation_rec_empty_list)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -115,7 +115,7 @@ START_TEST(pack_1711_federation_rec_empty_list)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1808_null_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_null_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -134,7 +134,7 @@ START_TEST(pack_1808_null_federation_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1808_federation_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_federation_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -170,7 +170,7 @@ START_TEST(pack_1808_federation_rec)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1808_federation_rec_empty_list)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_federation_rec_empty_list)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
@@ -208,13 +208,13 @@ Suite* suite(void)
Philip Kovacs b8cc3a
 	Suite* s = suite_create("Pack slurmdb_federation_rec_t");
Philip Kovacs b8cc3a
 	TCase* tc_core = tcase_create("Pack slurmdb_federation_rec_t");
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, invalid_protocol);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_null_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_federation_rec_empty_list);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_null_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_federation_rec_empty_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1808_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1808_null_federation_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1808_federation_rec_empty_list);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_null_federation_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_federation_rec_empty_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	suite_add_tcase(s, tc_core);
Philip Kovacs b8cc3a
 	return s;
Philip Kovacs b8cc3a
commit 549b1a3e6a8f6a677228209a2520595ffb42f98c
Philip Kovacs b8cc3a
Author: Morris Jette <jette@schedmd.com>
Philip Kovacs b8cc3a
Date:   Fri Jun 7 09:50:14 2019 -0600
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
    Make check tests made more generic
Philip Kovacs b8cc3a
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c b/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
index ca95f636a8..85adb59ed1 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c
Philip Kovacs b8cc3a
@@ -33,7 +33,7 @@ START_TEST(pack_null_req)
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 #endif
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_req_null_ptrs)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_req_null_ptrs)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -59,7 +59,7 @@ START_TEST(pack_1702_req_null_ptrs)
Philip Kovacs b8cc3a
 	unpack_req = (job_alloc_info_msg_t *)msg.data;
Philip Kovacs b8cc3a
 	ck_assert_int_eq(rc, SLURM_SUCCESS);
Philip Kovacs b8cc3a
 	ck_assert(unpack_req);
Philip Kovacs b8cc3a
-	//ck_assert(!unpack_req->req_cluster); /* >= 17.11 */
Philip Kovacs b8cc3a
+	ck_assert(!unpack_req->req_cluster);
Philip Kovacs b8cc3a
 	ck_assert_uint_eq(unpack_req->job_id, pack_req.job_id);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
@@ -67,7 +67,7 @@ START_TEST(pack_1702_req_null_ptrs)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_req)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_req)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -103,7 +103,7 @@ START_TEST(pack_1702_req)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_req_null_ptrs)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_req_null_ptrs)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -136,7 +136,7 @@ START_TEST(pack_1711_req_null_ptrs)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_req)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_req)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -188,10 +188,10 @@ Suite* suite(SRunner *sr)
Philip Kovacs b8cc3a
        if (srunner_fork_status(sr) != CK_NOFORK)
Philip Kovacs b8cc3a
                tcase_add_test_raise_signal(tc_core, pack_null_req, SIGABRT);
Philip Kovacs b8cc3a
 #endif
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_req_null_ptrs);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_req);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_req_null_ptrs);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_req);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_req_null_ptrs);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_req);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_req_null_ptrs);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_req);
Philip Kovacs b8cc3a
 	suite_add_tcase(s, tc_core);
Philip Kovacs b8cc3a
 	return s;
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
diff --git a/testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c b/testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c
Philip Kovacs b8cc3a
index c58149b48f..b2c6042888 100644
Philip Kovacs b8cc3a
--- a/testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c
Philip Kovacs b8cc3a
+++ b/testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c
Philip Kovacs b8cc3a
@@ -20,7 +20,7 @@ START_TEST(invalid_protocol)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_null_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_null_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	slurmdb_cluster_rec_t pack_rec;
Philip Kovacs b8cc3a
@@ -64,7 +64,7 @@ START_TEST(pack_1702_null_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -85,6 +85,9 @@ START_TEST(pack_1702_rec)
Philip Kovacs b8cc3a
 	pack_rec.name             = xstrdup("name");
Philip Kovacs b8cc3a
 	pack_rec.nodes            = xstrdup("nodes");
Philip Kovacs b8cc3a
 	pack_rec.plugin_id_select = 8;
Philip Kovacs b8cc3a
+	pack_rec.fed.feature_list = list_create(slurm_destroy_char);
Philip Kovacs b8cc3a
+	slurm_addto_mode_char_list(pack_rec.fed.feature_list, "a,b,c", 0);
Philip Kovacs b8cc3a
+	ck_assert_int_eq(list_count(pack_rec.fed.feature_list), 3);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* will be tested separately. */
Philip Kovacs b8cc3a
 	pack_rec.root_assoc       = NULL;
Philip Kovacs b8cc3a
@@ -126,9 +129,14 @@ START_TEST(pack_1702_rec)
Philip Kovacs b8cc3a
 	ck_assert_str_eq(pack_rec.name, unpack_rec->name);
Philip Kovacs b8cc3a
 	ck_assert_str_eq(pack_rec.nodes, unpack_rec->nodes);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	/* 17.11 */
Philip Kovacs b8cc3a
-	ck_assert(pack_rec.fed.feature_list == unpack_rec->fed.feature_list);
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
+	char *feature;
Philip Kovacs b8cc3a
+	ck_assert_int_eq(list_count(pack_rec.fed.feature_list), list_count(unpack_rec->fed.feature_list));
Philip Kovacs b8cc3a
+	ListIterator itr = list_iterator_create(pack_rec.fed.feature_list);
Philip Kovacs b8cc3a
+	while ((feature = list_next(itr))) {
Philip Kovacs b8cc3a
+		if (!list_find_first(unpack_rec->fed.feature_list, slurm_find_char_in_list, feature))
Philip Kovacs b8cc3a
+			ck_abort_msg("Didn't find feature %s in unpacked list",
Philip Kovacs b8cc3a
+				     feature);
Philip Kovacs b8cc3a
+	}
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	FREE_NULL_LIST(pack_rec.accounting_list);
Philip Kovacs b8cc3a
 	xfree(pack_rec.control_host);
Philip Kovacs b8cc3a
@@ -140,7 +148,7 @@ START_TEST(pack_1702_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1702_rec_null_ptrs)
Philip Kovacs b8cc3a
+START_TEST(pack_back2_rec_null_ptrs)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
 	slurmdb_cluster_rec_t pack_rec = {0};
Philip Kovacs b8cc3a
@@ -185,7 +193,6 @@ START_TEST(pack_1702_rec_null_ptrs)
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.rpc_version      == unpack_rec->rpc_version);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.recv         == unpack_rec->fed.recv);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.send         == unpack_rec->fed.send);
Philip Kovacs b8cc3a
-	/* 17.11 */
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.feature_list == unpack_rec->fed.feature_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
@@ -193,7 +200,7 @@ START_TEST(pack_1702_rec_null_ptrs)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_null_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_null_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	slurmdb_cluster_rec_t pack_rec;
Philip Kovacs b8cc3a
@@ -204,7 +211,6 @@ START_TEST(pack_1711_null_rec)
Philip Kovacs b8cc3a
 	pack_rec.fed.state        = 0;
Philip Kovacs b8cc3a
 	pack_rec.dimensions       = 1;
Philip Kovacs b8cc3a
 	pack_rec.plugin_id_select = NO_VAL;
Philip Kovacs b8cc3a
-
Philip Kovacs b8cc3a
 	slurmdb_pack_cluster_rec(NULL, SLURM_ONE_BACK_PROTOCOL_VERSION, buf);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	set_buf_offset(buf, 0);
Philip Kovacs b8cc3a
@@ -218,7 +224,6 @@ START_TEST(pack_1711_null_rec)
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.nodes           == unpack_rec->nodes);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.recv        == unpack_rec->fed.recv);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.send        == unpack_rec->fed.send);
Philip Kovacs b8cc3a
-	/* 17.11 */
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.feature_list == unpack_rec->fed.feature_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	/* root_assoc gets unpacked into a empty structure */
Philip Kovacs b8cc3a
@@ -237,7 +242,7 @@ START_TEST(pack_1711_null_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_rec)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_rec)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	int rc;
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
@@ -302,7 +307,6 @@ START_TEST(pack_1711_rec)
Philip Kovacs b8cc3a
 	ck_assert_str_eq(pack_rec.name, unpack_rec->name);
Philip Kovacs b8cc3a
 	ck_assert_str_eq(pack_rec.nodes, unpack_rec->nodes);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	/* 17.11 */
Philip Kovacs b8cc3a
 	char *feature;
Philip Kovacs b8cc3a
 	ck_assert_int_eq(list_count(pack_rec.fed.feature_list), list_count(unpack_rec->fed.feature_list));
Philip Kovacs b8cc3a
 	ListIterator itr = list_iterator_create(pack_rec.fed.feature_list);
Philip Kovacs b8cc3a
@@ -322,7 +326,7 @@ START_TEST(pack_1711_rec)
Philip Kovacs b8cc3a
 }
Philip Kovacs b8cc3a
 END_TEST
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-START_TEST(pack_1711_rec_null_ptrs)
Philip Kovacs b8cc3a
+START_TEST(pack_back1_rec_null_ptrs)
Philip Kovacs b8cc3a
 {
Philip Kovacs b8cc3a
 	Buf buf = init_buf(1024);
Philip Kovacs b8cc3a
 	slurmdb_cluster_rec_t pack_rec = {0};
Philip Kovacs b8cc3a
@@ -367,7 +371,6 @@ START_TEST(pack_1711_rec_null_ptrs)
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.rpc_version      == unpack_rec->rpc_version);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.recv         == unpack_rec->fed.recv);
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.send         == unpack_rec->fed.send);
Philip Kovacs b8cc3a
-	/* 17.11 */
Philip Kovacs b8cc3a
 	ck_assert(pack_rec.fed.feature_list == unpack_rec->fed.feature_list);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	free_buf(buf);
Philip Kovacs b8cc3a
@@ -385,13 +388,13 @@ Suite* suite(void)
Philip Kovacs b8cc3a
 	TCase* tc_core = tcase_create("Pack slurmdb_cluster_rec_t");
Philip Kovacs b8cc3a
 	tcase_add_test(tc_core, invalid_protocol);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_null_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1711_rec_null_ptrs);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_null_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back1_rec_null_ptrs);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_null_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_rec);
Philip Kovacs b8cc3a
-	tcase_add_test(tc_core, pack_1702_rec_null_ptrs);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_null_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_rec);
Philip Kovacs b8cc3a
+	tcase_add_test(tc_core, pack_back2_rec_null_ptrs);
Philip Kovacs b8cc3a
 
Philip Kovacs b8cc3a
 	suite_add_tcase(s, tc_core);
Philip Kovacs b8cc3a
 	return s;