Introduce NM BTS Site Manager FSM

Change-Id: Ic001ce6ebeff6f51470ef58140b0235f4a30265e
diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am
index a245b51..55a1339 100644
--- a/tests/abis/Makefile.am
+++ b/tests/abis/Makefile.am
@@ -31,6 +31,8 @@
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/Makefile.am b/tests/acc/Makefile.am
index 4726ddc..460d473 100644
--- a/tests/acc/Makefile.am
+++ b/tests/acc/Makefile.am
@@ -31,6 +31,8 @@
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/acc_test.c b/tests/acc/acc_test.c
index f463a2e..81b9e8d 100644
--- a/tests/acc/acc_test.c
+++ b/tests/acc/acc_test.c
@@ -497,6 +497,7 @@
 	log_set_print_category_hex(osmo_stderr_target, false);
 	log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
 	log_set_use_color(osmo_stderr_target, 0);
+	osmo_fsm_log_addr(false);
 
 	net = gsm_network_init(tall_bsc_ctx);
 	if (!net) {
diff --git a/tests/acc/acc_test.ok b/tests/acc/acc_test.ok
index 866502e..1428e40 100644
--- a/tests/acc/acc_test.ok
+++ b/tests/acc/acc_test.ok
@@ -1,4 +1,5 @@
 ===test_acc_mgr_no_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_no_ramp()
 do_allowed_len_adm_loop(1)
@@ -105,8 +106,10 @@
 *** Barring zero ACCs ***
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 pcu_info_update(): t2=0x00 t3=0x00, allowed: 0 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_no_ramp()
 ===test_acc_mgr_manual_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_manual_ramp()
 do_allowed_len_ramp_loop(1)
@@ -343,8 +346,10 @@
 pcu_info_update(): t2=0x03 t3=0xff, allowed:
 (bts=0) ACC: New ACC allowed subset 0x24c (active_len=4, ramp_len=4, adm_len=4, perm_len=4, rotation=off)
 pcu_info_update(): t2=0x01 t3=0xb3, allowed: 2 3 6 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_manual_ramp()
 ===test_acc_mgr_rotate(true, 1)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -412,8 +417,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x001 -> 0x002 (active_len=1, ramp_len=10, adm_len=1, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xfd, allowed: 1
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 1)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on)
@@ -478,8 +485,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x100 -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x01 t3=0xff, allowed: 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 2)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -547,8 +556,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x101 -> 0x003 (active_len=2, ramp_len=10, adm_len=2, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xfc, allowed: 0 1
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 2)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x300 (active_len=2, ramp_len=10, adm_len=2, perm_len=10, rotation=on)
@@ -613,8 +624,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x180 -> 0x300 (active_len=2, ramp_len=10, adm_len=2, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0xff, allowed: 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 3)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -682,8 +695,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x181 -> 0x103 (active_len=3, ramp_len=10, adm_len=3, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0xfc, allowed: 0 1 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 3)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x380 (active_len=3, ramp_len=10, adm_len=3, perm_len=10, rotation=on)
@@ -748,8 +763,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1c0 -> 0x380 (active_len=3, ramp_len=10, adm_len=3, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x7f, allowed: 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 4)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -817,8 +834,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1c1 -> 0x183 (active_len=4, ramp_len=10, adm_len=4, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x7c, allowed: 0 1 7 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 4)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3c0 (active_len=4, ramp_len=10, adm_len=4, perm_len=10, rotation=on)
@@ -883,8 +902,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1e0 -> 0x3c0 (active_len=4, ramp_len=10, adm_len=4, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x3f, allowed: 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -952,8 +973,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1e1 -> 0x1c3 (active_len=5, ramp_len=10, adm_len=5, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x3c, allowed: 0 1 6 7 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3e0 (active_len=5, ramp_len=10, adm_len=5, perm_len=10, rotation=on)
@@ -1018,8 +1041,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f0 -> 0x3e0 (active_len=5, ramp_len=10, adm_len=5, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x1f, allowed: 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 6)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1087,8 +1112,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f1 -> 0x1e3 (active_len=6, ramp_len=10, adm_len=6, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x1c, allowed: 0 1 5 6 7 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 6)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f0 (active_len=6, ramp_len=10, adm_len=6, perm_len=10, rotation=on)
@@ -1153,8 +1180,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f8 -> 0x3f0 (active_len=6, ramp_len=10, adm_len=6, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x0f, allowed: 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 7)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1222,8 +1251,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f9 -> 0x1f3 (active_len=7, ramp_len=10, adm_len=7, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x0c, allowed: 0 1 4 5 6 7 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 7)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
@@ -1288,8 +1319,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fc -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x07, allowed: 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 8)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1357,8 +1390,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fd -> 0x1fb (active_len=8, ramp_len=10, adm_len=8, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x04, allowed: 0 1 3 4 5 6 7 8
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 8)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fc (active_len=8, ramp_len=10, adm_len=8, perm_len=10, rotation=on)
@@ -1423,8 +1458,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fe -> 0x3fc (active_len=8, ramp_len=10, adm_len=8, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x03, allowed: 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 9)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fe (active_len=9, ramp_len=10, adm_len=9, perm_len=10, rotation=on)
@@ -1489,8 +1526,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1ff -> 0x3fe (active_len=9, ramp_len=10, adm_len=9, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x01, allowed: 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x000 (active_len=0, ramp_len=0, adm_len=10, perm_len=10, rotation=off)
@@ -1524,8 +1563,10 @@
 sys={450.000000}: select()
 (bts=0) ACC: update ACC allowed active subset 0x1ff -> 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 pcu_info_update(): t2=0x00 t3=0x00, allowed: 0 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp()
 ===test_acc_ramp2===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp2()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
@@ -1541,8 +1582,10 @@
 (bts=0) ACC: update ACC allowed active subset 0x03f -> 0x07f (active_len=7, ramp_len=7, adm_len=7, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x03 t3=0x80, allowed: 0 1 2 3 4 5 6
 sys={15.000000}: select()
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp2()
 ===test_acc_ramp3===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp3()
 *** Barring some ACCs ***
@@ -1574,8 +1617,10 @@
 (bts=0) ACC: update ACC allowed active subset 0x15a -> 0x15a (active_len=5, ramp_len=9, adm_len=10, perm_len=5, rotation=off)
 sys={45.000000}: select()
 (bts=0) ACC: update ACC allowed active subset 0x15a -> 0x15a (active_len=5, ramp_len=10, adm_len=10, perm_len=5, rotation=off)
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp3()
 ===test_acc_ramp_up_rotate(0, 100, 100)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1663,8 +1708,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(0, 20, 50)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1752,8 +1799,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(70, 80, 90)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1841,8 +1890,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_updown_rotate(80, 90, 0, 100, 15)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -1960,8 +2011,10 @@
 sys={7000.000000}: select(47): chan_load_avg=75
 sys={7250.000000}: select(48): chan_load_avg=90
 sys={7500.000000}: select(49): chan_load_avg=100
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 50, 10, 100, 15)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2103,8 +2156,10 @@
 sys={4200.000000}: select(49): chan_load_avg=25
 (bts=0) ACC: rotate ACC allowed active subset 0x003 -> 0x006 (active_len=2, ramp_len=2, adm_len=10, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xf9, allowed: 1 2
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(50, 49, 0, 100, 10)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2256,8 +2311,10 @@
 sys={4200.000000}: select(49): chan_load_avg=90
 (bts=0) ACC: rotate ACC allowed active subset 0x01c -> 0x038 (active_len=3, ramp_len=3, adm_len=10, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xc7, allowed: 3 4 5
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 80, 30, 80, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2315,4 +2372,5 @@
 sys={12000.000000}: select(47): chan_load_avg=65
 sys={12250.000000}: select(48): chan_load_avg=70
 sys={12500.000000}: select(49): chan_load_avg=75
+NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am
index 468c032..d64915b 100644
--- a/tests/bsc/Makefile.am
+++ b/tests/bsc/Makefile.am
@@ -45,6 +45,8 @@
 	$(top_builddir)/src/osmo-bsc/handover_logic.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOVTY_LIBS) \
diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am
index 66e4072..656498f 100644
--- a/tests/gsm0408/Makefile.am
+++ b/tests/gsm0408/Makefile.am
@@ -34,6 +34,8 @@
 	$(top_builddir)/src/osmo-bsc/rest_octets.o \
 	$(top_builddir)/src/osmo-bsc/system_information.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am
index 0f7953c..4b8f269 100644
--- a/tests/handover/Makefile.am
+++ b/tests/handover/Makefile.am
@@ -80,6 +80,8 @@
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident_vty.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_ctrl.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_mgcp.o \
diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am
index 1cdcc50..05dc662 100644
--- a/tests/nanobts_omlattr/Makefile.am
+++ b/tests/nanobts_omlattr/Makefile.am
@@ -29,6 +29,8 @@
 	$(top_builddir)/src/osmo-bsc/bts.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
+	$(top_builddir)/src/osmo-bsc/nm_common_fsm.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \