@@ -2802,11 +2802,11 @@ DEFUN(cfg_bts_si2quater_neigh_del, cfg_bts_si2quater_neigh_del_cmd,
{
struct gsm_bts *bts = vty->index;
struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list;
- uint16_t arfcn = atoi(argv[1]);
+ uint16_t arfcn = atoi(argv[0]);
int r = osmo_earfcn_del(e, arfcn);
if (r < 0) {
vty_out(vty, "Unable to delete arfcn %u: %s%s", arfcn,
- strerror(r), VTY_NEWLINE);
+ strerror(-r), VTY_NEWLINE);
return CMD_WARNING;
}
@@ -231,6 +231,20 @@ class TestVTYNITB(TestVTYGenericBSC):
self.assertEquals(self.vty.node(), 'config-mncc-int')
+ def testSi2Q(self):
+ self.vty.enable()
+ self.vty.command("configure terminal")
+ self.vty.command("network")
+ self.vty.command("bts 0")
+ before = self.vty.command("show running-config")
+ self.vty.command("si2quater neighbor-list add earfcn 1911 threshold 11 2")
+ self.vty.command("si2quater neighbor-list add earfcn 1924 threshold 11 3")
+ self.vty.command("si2quater neighbor-list add earfcn 2111 threshold 11")
+ self.vty.command("si2quater neighbor-list del earfcn 1911")
+ self.vty.command("si2quater neighbor-list del earfcn 1924")
+ self.vty.command("si2quater neighbor-list del earfcn 2111")
+ self.assertEquals(before, self.vty.command("show running-config"))
+
def testEnableDisablePeriodicLU(self):
self.vty.enable()
self.vty.command("configure terminal")
From: Max <msuraev@sysmocom.de> * fix typo in arg index * fix sign in error reporting * add vty test --- openbsc/src/libbsc/bsc_vty.c | 4 ++-- openbsc/tests/vty_test_runner.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-)