hnb-test: Add an option to transmit multiple UE register/deregister msgs
diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c
index e5f4951..325ace8 100644
--- a/src/tests/hnb-test.c
+++ b/src/tests/hnb-test.c
@@ -91,6 +91,12 @@
 	char imsi_buf[16];
 	char *imsi_str = "262019876543210";
 
+	if (hnb_test->ues > 0) {
+		hnb_test->ues--;
+	} else {
+		return 0;
+	}
+
 	UERegisterRequest_t request_out;
 	UERegisterRequestIEs_t request;
 	memset(&request, 0, sizeof(request));
@@ -189,6 +195,7 @@
 		break;
 	case ProcedureCode_id_UERegister:
 		rc = hnb_test_rx_ue_register_acc(hnb, &pdu->choice.successfulOutcome.value);
+		hnb_test_ue_register_tx(hnb);
 		break;
 	default:
 		break;
@@ -363,6 +370,28 @@
 	return rc;
 }
 
+static void handle_options(int argc, char **argv)
+{
+	while (1) {
+		int idx = 0, c;
+		static const struct option long_options[] = {
+			{ "ues", 1, 0, 'u' },
+			{ 0, 0, 0, 0 },
+		};
+
+		c = getopt_long(argc, argv, "u:", long_options, &idx);
+
+		if (c == -1)
+			break;
+
+		switch (c) {
+		case 'u':
+			g_hnb_test.ues = atoi(optarg);
+			break;
+		}
+	}
+}
+
 int main(int argc, const char *argv)
 {
 	int rc;
@@ -376,6 +405,8 @@
 
 	vty_init(&vty_info);
 
+	handle_options(argc, argv);
+
 	osmo_wqueue_init(&g_hnb_test.wqueue, 16);
 	g_hnb_test.wqueue.bfd.data = &g_hnb_test;
 	g_hnb_test.wqueue.read_cb = hnb_read_cb;