[PATCH] osmo-pcu[master]: AllocTest: expand test output

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Mon Nov 27 12:52:06 UTC 2017


Hello Jenkins Builder, Holger Freyther,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4957

to look at the new patch set (#2).

AllocTest: expand test output

* print MS classes
* unify and print test mode description
* print additional info on test completion

This only changes meta info about test run but not the actual test
output.

Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2
Related: OS#2282
---
M tests/alloc/AllocTest.cpp
M tests/alloc/AllocTest.ok
2 files changed, 85 insertions(+), 101 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/57/4957/2

diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index f84ee69..bbc8c7e 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -432,6 +432,19 @@
 	TEST_MODE_UL_AFTER_DL,
 };
 
+static inline char *test_mode_descr(enum test_mode t)
+{
+	switch (t) {
+	case TEST_MODE_UL_ONLY: return (char*)"UL only";
+	case TEST_MODE_DL_ONLY: return (char*)"DL only";
+	case TEST_MODE_UL_AND_DL: return (char*)"UL and DL";
+	case TEST_MODE_DL_AND_UL: return (char*)"DL and UL";
+	case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL";
+	case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL";
+	default: return NULL;
+	}
+}
+
 static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class,
 	enum test_mode mode)
 {
@@ -617,7 +630,8 @@
 	struct gprs_rlcmac_trx *trx;
 	unsigned counter;
 
-	printf("Going to test assignment with many TBF, %s\n", text);
+	printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n",
+	       text, min_class, max_class, test_mode_descr(mode));
 
 	bts = the_bts.bts_data();
 	bts->alloc_algorithm = algo;
@@ -631,9 +645,11 @@
 
 	counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode);
 
-	printf("  Successfully allocated %d UL TBFs\n", counter);
+	printf("  Successfully allocated %u UL TBFs, algorithm %s class %u..%u (%s)\n",
+	       counter, text, min_class, max_class, test_mode_descr(mode));
 	if (counter != expect_num)
-		fprintf(stderr, "  Expected %d TBFs for %s\n", expect_num, text);
+		fprintf(stderr, "  Expected %u TBFs (got %u), algorithm %s class %u..%u (%s)\n",
+			expect_num, counter, text, min_class, max_class, test_mode_descr(mode));
 
 	OSMO_ASSERT(counter == expect_num);
 
@@ -655,7 +671,7 @@
 		TEST_MODE_DL_ONLY,
 	};
 
-	printf("Going to test assignment with many connections, %s\n", text);
+	printf("Going to test assignment with many connections, algorithm %s\n", text);
 
 	bts = the_bts.bts_data();
 	bts->alloc_algorithm = algo;
@@ -690,67 +706,33 @@
 
 	printf("  Successfully allocated %d TBFs\n", counter1);
 	if (counter1 != (int)expect_num)
-		fprintf(stderr, "  Expected %d TBFs for %s\n", expect_num, text);
+		fprintf(stderr, "  Expected %d TBFs (got %d) for algorithm %s\n", expect_num, counter1, text);
 
 	OSMO_ASSERT(expect_num == (unsigned)counter1);
 }
 
-static void test_successive_allocation()
+static inline void test_a_b_dyn(enum test_mode mode, uint8_t exp_A, uint8_t exp_B, uint8_t exp_dyn)
 {
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL,
-		35, "algorithm A (UL and DL)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL,
-		32, "algorithm B class 10 (UL and DL)");
-	test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL,
-		32, "algorithm B class 12 (UL and DL)");
-	test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL,
-		32, "algorithm B class 1-12 (UL and DL)");
-	test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL,
-		32, "algorithm B class 1-29 (UL and DL)");
-	test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL,
-		35, "algorithm dynamic class 1-29 (UL and DL)");
-
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL,
-		35, "algorithm A (DL and UL)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL,
-		32, "algorithm B class 10 (DL and UL)");
-	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL,
-		32, "algorithm dynamic class 10 (DL and UL)");
-
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL,
-		160, "algorithm A (DL after UL)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL,
-		32, "algorithm B class 10 (DL after UL)");
-	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL,
-		95, "algorithm dynamic class 10 (DL after UL)");
-
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL,
-		35, "algorithm A (UL after DL)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL,
-		32, "algorithm B class 10 (UL after DL)");
-	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL,
-		35, "algorithm dynamic class 10 (UL after DL)");
-
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY,
-		35, "algorithm A (UL only)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY,
-		32, "algorithm B class 10 (UL only)");
-	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY,
-		35, "algorithm dynamic class 10 (UL only)");
-
-	test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY,
-		160, "algorithm A (DL ONLY)");
-	test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY,
-		32, "algorithm B class 10 (DL ONLY)");
-	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY,
-		101, "algorithm dynamic class 10 (DL ONLY)");
+	test_successive_allocation(alloc_algorithm_a,        1,  1, mode, exp_A,   "A");
+	test_successive_allocation(alloc_algorithm_b,       10, 10, mode, exp_B,   "B");
+	test_successive_allocation(alloc_algorithm_dynamic, 10, 10, mode, exp_dyn, "dynamic");
 }
 
-static void test_many_connections()
+static void test_successive_allocations()
 {
-	test_many_connections(alloc_algorithm_a, 160, "algorithm A");
-	test_many_connections(alloc_algorithm_b, 32, "algorithm B");
-	test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic");
+	test_successive_allocation(alloc_algorithm_a,       1,  1, TEST_MODE_UL_AND_DL, 35, "A");
+	test_successive_allocation(alloc_algorithm_b,      10, 10, TEST_MODE_UL_AND_DL, 32, "B");
+	test_successive_allocation(alloc_algorithm_b,      12, 12, TEST_MODE_UL_AND_DL, 32, "B");
+
+	test_successive_allocation(alloc_algorithm_b,       1, 12, TEST_MODE_UL_AND_DL, 32, "B");
+	test_successive_allocation(alloc_algorithm_b,       1, 29, TEST_MODE_UL_AND_DL, 32, "B");
+	test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, 35, "dynamic");
+
+	test_a_b_dyn(TEST_MODE_DL_AND_UL,    35, 32,  32);
+	test_a_b_dyn(TEST_MODE_DL_AFTER_UL, 160, 32,  95);
+	test_a_b_dyn(TEST_MODE_UL_AFTER_DL,  35, 32,  35);
+	test_a_b_dyn(TEST_MODE_UL_ONLY,      35, 32,  35);
+	test_a_b_dyn(TEST_MODE_DL_ONLY,     160, 32, 101);
 }
 
 static void test_2_consecutive_dl_tbfs()
@@ -818,8 +800,10 @@
 
 	test_alloc_a();
 	test_alloc_b();
-	test_successive_allocation();
-	test_many_connections();
+	test_successive_allocations();
+	test_many_connections(alloc_algorithm_a, 160, "A");
+	test_many_connections(alloc_algorithm_b, 32, "B");
+	test_many_connections(alloc_algorithm_dynamic, 160, "dynamic");
 	test_2_consecutive_dl_tbfs();
 	return EXIT_SUCCESS;
 }
diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok
index cbb65aa..a46bedb 100644
--- a/tests/alloc/AllocTest.ok
+++ b/tests/alloc/AllocTest.ok
@@ -8588,7 +8588,7 @@
 Mass test: TS0(OOOOOOOO)TS7 MS_Class=27
 Mass test: TS0(OOOOOOOO)TS7 MS_Class=28
 Mass test: TS0(OOOOOOOO)TS7 MS_Class=29
-Going to test assignment with many TBF, algorithm A (UL and DL)
+Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL)
  TBF[0] class 1 reserves ...C....
  TBF[0] class 1 reserves ....C...
  TBF[0] class 1 reserves .....C..
@@ -8624,8 +8624,8 @@
  TBF[6] class 1 reserves .....C..
  TBF[6] class 1 reserves ......C.
  TBF[6] class 1 reserves .......C
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (UL and DL)
+  Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL)
+Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -8658,8 +8658,8 @@
  TBF[29] class 10 reserves ...CD...
  TBF[30] class 10 reserves ...CD...
  TBF[31] class 10 reserves ...CD...
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm B class 12 (UL and DL)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL)
+Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL)
  TBF[0] class 12 reserves ...DDCD.
  TBF[1] class 12 reserves .....DCD
  TBF[2] class 12 reserves ...DCD..
@@ -8692,8 +8692,8 @@
  TBF[29] class 12 reserves ...CD...
  TBF[30] class 12 reserves ...CD...
  TBF[31] class 12 reserves ...CD...
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL)
+  Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL)
+Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL)
  TBF[0] class 1 reserves ...C....
  TBF[1] class 2 reserves ....DC..
  TBF[2] class 3 reserves ......DC
@@ -8726,8 +8726,8 @@
  TBF[29] class 6 reserves ......CD
  TBF[30] class 7 reserves ...CD...
  TBF[31] class 8 reserves ...DDCD.
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL)
+  Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL)
+Going to test assignment with many TBF, algorithm B class 1..29 (UL and DL)
  TBF[0] class 1 reserves ...C....
  TBF[1] class 2 reserves ....DC..
  TBF[2] class 3 reserves ......DC
@@ -8760,8 +8760,8 @@
  TBF[29] class 1 reserves ...C....
  TBF[30] class 2 reserves ......DC
  TBF[31] class 3 reserves ....DC..
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 1-29 (UL and DL)
+  Successfully allocated 32 UL TBFs, algorithm B class 1..29 (UL and DL)
+Going to test assignment with many TBF, algorithm dynamic class 1..29 (UL and DL)
  TBF[0] class 1 reserves ...C....
  TBF[1] class 2 reserves ....DC..
  TBF[2] class 3 reserves ......DC
@@ -8797,8 +8797,8 @@
  TBF[1] class 4 reserves ...C....
  TBF[2] class 5 reserves ...C....
  TBF[0] class 6 reserves ......C.
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm A (DL and UL)
+  Successfully allocated 35 UL TBFs, algorithm dynamic class 1..29 (UL and DL)
+Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL)
  TBF[0] class 1 reserves ...C....
  TBF[0] class 1 reserves ....C...
  TBF[0] class 1 reserves .....C..
@@ -8834,8 +8834,8 @@
  TBF[6] class 1 reserves .....C..
  TBF[6] class 1 reserves ......C.
  TBF[6] class 1 reserves .......C
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (DL and UL)
+  Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL)
+Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -8868,8 +8868,8 @@
  TBF[29] class 10 reserves ...CD...
  TBF[30] class 10 reserves .....DDC
  TBF[31] class 10 reserves ...CD...
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 10 (DL and UL)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL)
+Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -8902,8 +8902,8 @@
  TBF[29] class 10 reserves ...CD...
  TBF[30] class 10 reserves .....DDC
  TBF[31] class 10 reserves ...CD...
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm A (DL after UL)
+  Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL)
+Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL)
  TBF[0] class 1 reserves ...C....
  TBF[0] class 1 reserves ....C...
  TBF[0] class 1 reserves .....C..
@@ -9064,8 +9064,8 @@
  TBF[31] class 1 reserves .....C..
  TBF[31] class 1 reserves ......C.
  TBF[31] class 1 reserves .......C
-  Successfully allocated 160 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (DL after UL)
+  Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL)
+Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -9098,8 +9098,8 @@
  TBF[29] class 10 reserves .....DCD
  TBF[30] class 10 reserves ...DCD..
  TBF[31] class 10 reserves .....DCD
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 10 (DL after UL)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL)
+Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -9195,8 +9195,8 @@
  TBF[28] class 10 reserves ......C.
  TBF[31] class 10 reserves ....C...
  TBF[30] class 10 reserves ......C.
-  Successfully allocated 95 UL TBFs
-Going to test assignment with many TBF, algorithm A (UL after DL)
+  Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL)
+Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL)
  TBF[0] class 1 reserves ...U....
  TBF[0] class 1 reserves ....U...
  TBF[0] class 1 reserves .....U..
@@ -9232,8 +9232,8 @@
  TBF[6] class 1 reserves .....U..
  TBF[6] class 1 reserves ......U.
  TBF[6] class 1 reserves .......U
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (UL after DL)
+  Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL)
+Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL)
  TBF[0] class 10 reserves .....U..
  TBF[1] class 10 reserves ......U.
  TBF[2] class 10 reserves ....U...
@@ -9266,8 +9266,8 @@
  TBF[29] class 10 reserves ...U....
  TBF[30] class 10 reserves .......U
  TBF[31] class 10 reserves ...U....
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 10 (UL after DL)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL)
+Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL)
  TBF[0] class 10 reserves .....U..
  TBF[1] class 10 reserves ......U.
  TBF[2] class 10 reserves ....U...
@@ -9303,8 +9303,8 @@
  TBF[0] class 10 reserves ...U....
  TBF[1] class 10 reserves ...U....
  TBF[2] class 10 reserves ...U....
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm A (UL only)
+  Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL)
+Going to test assignment with many TBF, algorithm A class 1..1 (UL only)
  TBF[0] class 1 reserves ...U....
  TBF[0] class 1 reserves ....U...
  TBF[0] class 1 reserves .....U..
@@ -9340,8 +9340,8 @@
  TBF[6] class 1 reserves .....U..
  TBF[6] class 1 reserves ......U.
  TBF[6] class 1 reserves .......U
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (UL only)
+  Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only)
+Going to test assignment with many TBF, algorithm B class 10..10 (UL only)
  TBF[0] class 10 reserves .....U..
  TBF[1] class 10 reserves ......U.
  TBF[2] class 10 reserves ....U...
@@ -9374,8 +9374,8 @@
  TBF[29] class 10 reserves ...U....
  TBF[30] class 10 reserves ...U....
  TBF[31] class 10 reserves ...U....
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 10 (UL only)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only)
+Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only)
  TBF[0] class 10 reserves .....U..
  TBF[1] class 10 reserves ......U.
  TBF[2] class 10 reserves ....U...
@@ -9411,8 +9411,8 @@
  TBF[0] class 10 reserves ...U....
  TBF[1] class 10 reserves ...U....
  TBF[2] class 10 reserves ...U....
-  Successfully allocated 35 UL TBFs
-Going to test assignment with many TBF, algorithm A (DL ONLY)
+  Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only)
+Going to test assignment with many TBF, algorithm A class 1..1 (DL only)
  TBF[0] class 1 reserves ...C....
  TBF[0] class 1 reserves ....C...
  TBF[0] class 1 reserves .....C..
@@ -9573,8 +9573,8 @@
  TBF[31] class 1 reserves .....C..
  TBF[31] class 1 reserves ......C.
  TBF[31] class 1 reserves .......C
-  Successfully allocated 160 UL TBFs
-Going to test assignment with many TBF, algorithm B class 10 (DL ONLY)
+  Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only)
+Going to test assignment with many TBF, algorithm B class 10..10 (DL only)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -9607,8 +9607,8 @@
  TBF[29] class 10 reserves .....DCD
  TBF[30] class 10 reserves ...CD...
  TBF[31] class 10 reserves ...CD...
-  Successfully allocated 32 UL TBFs
-Going to test assignment with many TBF, algorithm dynamic class 10 (DL ONLY)
+  Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only)
+Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only)
  TBF[0] class 10 reserves ...DDCD.
  TBF[1] class 10 reserves .....DCD
  TBF[2] class 10 reserves ...DCD..
@@ -9710,7 +9710,7 @@
  TBF[29] class 10 reserves ....C...
  TBF[31] class 10 reserves ......C.
  TBF[31] class 10 reserves .......C
-  Successfully allocated 101 UL TBFs
+  Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only)
 Going to test assignment with many connections, algorithm A
  TBF[0] class 1 reserves ...C....
  TBF[0] class 2 reserves ....C...

-- 
To view, visit https://gerrit.osmocom.org/4957
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list