2011-11-13 00:02:54 +00:00
|
|
|
AT_INIT
|
|
|
|
AT_BANNER([Regression tests.])
|
|
|
|
|
|
|
|
|
|
|
|
# todo.. create one macro for it
|
2011-11-17 19:33:19 +00:00
|
|
|
AT_SETUP([a5])
|
|
|
|
AT_KEYWORDS([a5])
|
|
|
|
cat $abs_srcdir/a5/a5_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/a5/a5_test], [0], [expout])
|
2011-11-17 19:33:19 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-03-24 19:16:33 +00:00
|
|
|
AT_SETUP([abis])
|
|
|
|
AT_KEYWORDS([abis])
|
|
|
|
cat $abs_srcdir/abis/abis_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/abis/abis_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-02-24 12:59:14 +00:00
|
|
|
AT_SETUP([ctrl])
|
|
|
|
AT_KEYWORDS([ctrl])
|
|
|
|
cat $abs_srcdir/ctrl/ctrl_test.ok > expout
|
2017-09-26 12:21:44 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/ctrl/ctrl_test], [0], [expout], [ignore])
|
2017-02-24 12:59:14 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2014-06-16 12:59:30 +00:00
|
|
|
AT_SETUP([kasumi])
|
|
|
|
AT_KEYWORDS([kasumi])
|
|
|
|
cat $abs_srcdir/kasumi/kasumi_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/kasumi/kasumi_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_SETUP([bits])
|
|
|
|
AT_KEYWORDS([bits])
|
|
|
|
cat $abs_srcdir/bits/bitrev_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/bits/bitrev_test], [0], [expout])
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2015-12-21 15:04:03 +00:00
|
|
|
AT_SETUP([bitvec])
|
|
|
|
AT_KEYWORDS([bitvec])
|
|
|
|
cat $abs_srcdir/bitvec/bitvec_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/bitvec/bitvec_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-02-05 12:55:38 +00:00
|
|
|
AT_SETUP([bitcomp])
|
|
|
|
AT_KEYWORDS([bitcomp])
|
|
|
|
cat $abs_srcdir/bits/bitcomp_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/bits/bitcomp_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-10-18 11:14:49 +00:00
|
|
|
AT_SETUP([bitfield])
|
|
|
|
AT_KEYWORDS([bitfield])
|
|
|
|
cat $abs_srcdir/bits/bitfield_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/bits/bitfield_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2011-11-24 16:48:42 +00:00
|
|
|
AT_SETUP([conv])
|
|
|
|
AT_KEYWORDS([conv])
|
|
|
|
cat $abs_srcdir/conv/conv_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/conv/conv_test], [0], [expout])
|
2011-11-24 16:48:42 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-01-19 10:01:15 +00:00
|
|
|
AT_SETUP([conv_gsm0503])
|
|
|
|
AT_KEYWORDS([conv_gsm0503])
|
|
|
|
cat $abs_srcdir/conv/conv_gsm0503_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/conv/conv_gsm0503_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-09-22 18:48:59 +00:00
|
|
|
AT_SETUP([coding])
|
|
|
|
AT_KEYWORDS([coding])
|
|
|
|
cat $abs_srcdir/coding/coding_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/coding/coding_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2015-11-27 12:26:16 +00:00
|
|
|
AT_SETUP([msgb])
|
|
|
|
AT_KEYWORDS([msgb])
|
|
|
|
cat $abs_srcdir/msgb/msgb_test.ok > expout
|
2015-11-27 12:26:17 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/msgb/msgb_test], [0], [expout], [ignore])
|
2015-11-27 12:26:16 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-06-30 08:39:00 +00:00
|
|
|
AT_SETUP([gea])
|
|
|
|
AT_KEYWORDS([gea])
|
|
|
|
cat $abs_srcdir/gea/gea_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gea/gea_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
if ENABLE_MSGFILE
|
|
|
|
AT_SETUP([msgfile])
|
|
|
|
AT_KEYWORDS([msgfile])
|
|
|
|
cp $abs_srcdir/msgfile/msgconfig.cfg .
|
|
|
|
cat $abs_srcdir/msgfile/msgfile_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/msgfile/msgfile_test], [0], [expout])
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
endif
|
|
|
|
|
|
|
|
AT_SETUP([sms])
|
|
|
|
AT_KEYWORDS([sms])
|
|
|
|
cat $abs_srcdir/sms/sms_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/sms/sms_test], [0], [expout])
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
AT_SETUP([smscb])
|
|
|
|
AT_KEYWORDS([smscb])
|
|
|
|
cat $abs_srcdir/smscb/smscb_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/smscb/smscb_test], [0], [expout])
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
AT_SETUP([ussd])
|
|
|
|
AT_KEYWORDS([ussd])
|
|
|
|
cat $abs_srcdir/ussd/ussd_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/ussd/ussd_test], [0], [expout], [ignore])
|
2011-11-13 00:02:54 +00:00
|
|
|
AT_CLEANUP
|
2011-12-06 23:10:18 +00:00
|
|
|
|
|
|
|
AT_SETUP([auth])
|
|
|
|
AT_KEYWORDS([auth])
|
|
|
|
cat $abs_srcdir/auth/milenage_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/auth/milenage_test], [0], [expout], [ignore])
|
2011-12-06 23:10:18 +00:00
|
|
|
AT_CLEANUP
|
2011-12-11 19:25:12 +00:00
|
|
|
|
2013-12-02 10:30:32 +00:00
|
|
|
AT_SETUP([comp128])
|
|
|
|
AT_KEYWORDS([comp128])
|
|
|
|
cat $abs_srcdir/comp128/comp128_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/comp128/comp128_test], [0], [expout])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2011-12-11 19:25:12 +00:00
|
|
|
AT_SETUP([lapd])
|
|
|
|
AT_KEYWORDS([lapd])
|
|
|
|
cat $abs_srcdir/lapd/lapd_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/lapd/lapd_test], [0], [expout], [ignore])
|
2011-12-11 19:25:12 +00:00
|
|
|
AT_CLEANUP
|
2012-01-22 12:36:52 +00:00
|
|
|
|
2019-10-09 11:38:38 +00:00
|
|
|
AT_SETUP([gsm0502])
|
|
|
|
AT_KEYWORDS([gsm0502])
|
|
|
|
cat $abs_srcdir/gsm0502/gsm0502_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsm0502/gsm0502_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2012-01-22 12:36:52 +00:00
|
|
|
AT_SETUP([gsm0808])
|
|
|
|
AT_KEYWORDS([gsm0808])
|
|
|
|
cat $abs_srcdir/gsm0808/gsm0808_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsm0808/gsm0808_test], [0], [expout], [ignore])
|
2012-01-22 12:36:52 +00:00
|
|
|
AT_CLEANUP
|
2012-08-24 19:27:26 +00:00
|
|
|
|
2018-12-10 09:57:59 +00:00
|
|
|
AT_SETUP([gsm29205])
|
|
|
|
AT_KEYWORDS([gsm29205])
|
|
|
|
cat $abs_srcdir/gsm29205/gsm29205_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsm29205/gsm29205_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2012-08-24 19:27:26 +00:00
|
|
|
AT_SETUP([gsm0408])
|
|
|
|
AT_KEYWORDS([gsm0408])
|
|
|
|
cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [0], [expout], [ignore])
|
2012-08-24 19:27:26 +00:00
|
|
|
AT_CLEANUP
|
2012-09-27 12:18:37 +00:00
|
|
|
|
2015-11-17 07:42:05 +00:00
|
|
|
AT_SETUP([gprs])
|
|
|
|
AT_KEYWORDS([gprs])
|
|
|
|
cat $abs_srcdir/gprs/gprs_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gprs/gprs_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2012-09-27 12:18:37 +00:00
|
|
|
AT_SETUP([logging])
|
|
|
|
AT_KEYWORDS([logging])
|
|
|
|
cat $abs_srcdir/logging/logging_test.ok > expout
|
|
|
|
cat $abs_srcdir/logging/logging_test.err > experr
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/logging/logging_test], [0], [expout], [experr])
|
2012-09-27 12:18:37 +00:00
|
|
|
AT_CLEANUP
|
2012-11-11 13:21:26 +00:00
|
|
|
|
2016-05-25 16:13:51 +00:00
|
|
|
AT_SETUP([codec])
|
|
|
|
AT_KEYWORDS([codec])
|
|
|
|
cat $abs_srcdir/codec/codec_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/codec/codec_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-12-15 20:42:15 +00:00
|
|
|
AT_SETUP([codec_ecu_fr])
|
|
|
|
AT_KEYWORDS([codec_ecu_fr])
|
|
|
|
cat $abs_srcdir/codec/codec_ecu_fr_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/codec/codec_ecu_fr_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2012-11-11 13:21:26 +00:00
|
|
|
AT_SETUP([fr])
|
|
|
|
AT_KEYWORDS([fr])
|
|
|
|
cat $abs_srcdir/fr/fr_test.ok > expout
|
|
|
|
cat $abs_srcdir/fr/fr_test.err > experr
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/fr/fr_test], [0], [expout], [experr])
|
2012-11-11 13:21:26 +00:00
|
|
|
AT_CLEANUP
|
2013-02-21 05:16:29 +00:00
|
|
|
|
|
|
|
AT_SETUP([loggingrb])
|
|
|
|
AT_KEYWORDS([loggingrb])
|
|
|
|
cat $abs_srcdir/loggingrb/logging_test.ok > expout
|
|
|
|
cat $abs_srcdir/loggingrb/logging_test.err > experr
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/loggingrb/loggingrb_test], [0], [expout], [experr])
|
2013-02-21 05:16:29 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
AT_SETUP([strrb])
|
|
|
|
AT_KEYWORDS([strrb])
|
|
|
|
cat $abs_srcdir/strrb/strrb_test.ok > expout
|
2013-03-12 09:35:26 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/strrb/strrb_test], [0], [expout], [ignore])
|
2013-02-21 05:16:29 +00:00
|
|
|
AT_CLEANUP
|
2013-08-06 12:29:14 +00:00
|
|
|
|
|
|
|
AT_SETUP([vty])
|
|
|
|
AT_KEYWORDS([vty])
|
|
|
|
cat $abs_srcdir/vty/vty_test.ok > expout
|
VTY: implicit node exit by de-indenting, not parent lookup
Note: This will break users' config files if they do not use consistent
indenting. (see below for a definition of "consistent".)
When reading VTY commands from a file, use indenting as means to implicitly
exit child nodes. Do not look for commands in the parent node implicitly.
The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the
current node, but succeeds on the parent node. That is the mechanism by which
our VTY config files do not need 'exit' at the end of each child node.
We've hit problems with this in the following scenarios, which will show
improved user experience after this patch:
*) When both a parent and its child node have commands with identical names:
cs7 instace 0
point-code 1.2.3
sccp-address osmo-msc
point-code 0.0.1
If I put the parent's command below the child, it is still interpreted in the
context of the child node:
cs7 instace 0
sccp-address osmo-msc
point-code 0.0.1
point-code 1.2.3
Though the indenting lets me assume I am setting the cs7 instance's global PC
to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the
0.0.1.
*) When a software change moves a VTY command from a child to a parent. Say
'timezone' moved from 'bts' to 'network' level:
network
timezone 1 2
Say a user still has an old config file with 'timezone' on the child level:
network
bts 0
timezone 1 2
trx 0
The user would expect an error message that 'timezone' is invalid on the 'bts'
level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts'
to the 'network' level, and instead says that the 'trx' command does not exist.
Format:
Consistent means that two adjacent indenting lines have the exact
same indenting characters for the common length:
Weird mix if you ask me, but correct and consistent:
ROOT
<space>PARENT
<space><tab><space>CHILD
<space><tab><space><tab><tab>GRANDCHILD
<space><tab><space><tab><tab>GRANDCHILD2
<space>SIBLING
Inconsistent:
ROOT
<space>PARENT
<tab><space>CHILD
<space><space><tab>GRANDCHILD
<space><tab><tab>GRANDCHILD2
<tab>SIBLING
Also, when going back to a parent level, the exact same indenting must be used
as before in that node:
Incorrect:
ROOT
<tab>PARENT
<tab><tab><tab>CHILD
<tab><tab>SIBLING
As not really intended side effect, it is also permitted to indent the entire
file starting from the root level. We could guard against it but there's no
harm:
Correct and consistent:
<tab>ROOT
<tab><tab>PARENT
<tab><tab><tab><tab>CHILD
<tab><tab>SIBLING
Implementation:
Track parent nodes state: whenever a command enters a child node, push a parent
node onto an llist to remember the exact indentation characters used for that
level.
As soon as the first line on a child node is parsed, remember this new
indentation (which must have a longer strlen() than its parent level) to apply
to all remaining child siblings and grandchildren.
If the amount of spaces that indent a following VTY command are less than this
expected indentation, call vty_go_parent() until it matches up.
At any level, if the common length of indentation characters mismatch, abort
parsing in error.
Transitions to child node are spread across VTY implementations and are hard to
change. But transitions to the parent node are all handled by vty_go_parent().
By popping a parent from the list of parents in vty_go_parent(), we can also
detect that a command has changed the node without changing the parent, hence
it must have stepped into a child node, and we can push a parent frame.
The behavior on the interactive telnet VTY remains unchanged.
Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9
2017-09-07 01:08:06 +00:00
|
|
|
cp $abs_srcdir/vty/*.cfg .
|
2013-08-06 12:29:14 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2013-08-12 15:13:19 +00:00
|
|
|
|
2014-10-14 12:49:37 +00:00
|
|
|
AT_SETUP([gprs-bssgp])
|
|
|
|
AT_KEYWORDS([gprs-bssgp])
|
|
|
|
cat $abs_srcdir/gb/gprs_bssgp_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gb/gprs_bssgp_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2013-10-08 10:04:43 +00:00
|
|
|
AT_SETUP([gprs-ns])
|
|
|
|
AT_KEYWORDS([gprs-ns])
|
|
|
|
cat $abs_srcdir/gb/gprs_ns_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gb/gprs_ns_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2014-01-02 12:55:00 +00:00
|
|
|
AT_SETUP([utils])
|
|
|
|
AT_KEYWORDS([utils])
|
|
|
|
cat $abs_srcdir/utils/utils_test.ok > expout
|
2018-07-19 20:11:52 +00:00
|
|
|
cat $abs_srcdir/utils/utils_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/utils/utils_test], [0], [expout], [experr])
|
2014-01-02 12:55:00 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
2015-10-01 18:43:53 +00:00
|
|
|
AT_SETUP([stats])
|
|
|
|
AT_KEYWORDS([stats])
|
|
|
|
cat $abs_srcdir/stats/stats_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/stats/stats_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-11-12 20:25:21 +00:00
|
|
|
AT_SETUP([write_queue])
|
|
|
|
AT_KEYWORDS([write_queue])
|
|
|
|
cat $abs_srcdir/write_queue/wqueue_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/write_queue/wqueue_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2013-08-12 15:13:19 +00:00
|
|
|
AT_SETUP([bssgp-fc])
|
|
|
|
AT_KEYWORDS([bssgp-fc])
|
|
|
|
cat $abs_srcdir/gb/bssgp_fc_tests.ok > expout
|
|
|
|
cat $abs_srcdir/gb/bssgp_fc_tests.err > experr
|
|
|
|
AT_CHECK([$abs_top_srcdir/tests/gb/bssgp_fc_tests.sh $abs_top_builddir/tests/gb], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-03-14 20:04:50 +00:00
|
|
|
AT_SETUP([sim])
|
|
|
|
AT_KEYWORDS([sim])
|
2016-11-15 16:31:14 +00:00
|
|
|
AT_CHECK([test "x$enable_sim_test" = xyes || exit 77])
|
2016-03-14 20:04:50 +00:00
|
|
|
cat $abs_srcdir/sim/sim_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/sim/sim_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2013-08-12 15:13:19 +00:00
|
|
|
AT_SETUP([timer])
|
|
|
|
AT_KEYWORDS([timer])
|
|
|
|
cat $abs_srcdir/timer/timer_test.ok > expout
|
2016-09-22 02:21:50 +00:00
|
|
|
AT_CHECK([$abs_top_builddir/tests/timer/timer_test], [0], [expout], [ignore])
|
2018-02-26 18:42:22 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
AT_SETUP([clk_override])
|
|
|
|
AT_KEYWORDS([clk_override])
|
|
|
|
cat $abs_srcdir/timer/clk_override_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/timer/clk_override_test], [0], [expout], [ignore])
|
2013-08-12 15:13:19 +00:00
|
|
|
AT_CLEANUP
|
2016-04-25 13:19:35 +00:00
|
|
|
|
|
|
|
AT_SETUP([tlv])
|
|
|
|
AT_KEYWORDS([tlv])
|
|
|
|
cat $abs_srcdir/tlv/tlv_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/tlv/tlv_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2016-04-25 16:46:22 +00:00
|
|
|
|
|
|
|
AT_SETUP([gsup])
|
|
|
|
AT_KEYWORDS([gsup])
|
|
|
|
cat $abs_srcdir/gsup/gsup_test.ok > expout
|
2017-02-21 19:17:35 +00:00
|
|
|
cat $abs_srcdir/gsup/gsup_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsup/gsup_test], [0], [expout], [experr])
|
2016-04-25 16:46:22 +00:00
|
|
|
AT_CLEANUP
|
2016-05-29 01:53:17 +00:00
|
|
|
|
|
|
|
AT_SETUP([fsm])
|
|
|
|
AT_KEYWORDS([fsm])
|
|
|
|
cat $abs_srcdir/fsm/fsm_test.ok > expout
|
|
|
|
cat $abs_srcdir/fsm/fsm_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/fsm/fsm_test], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
2016-12-08 16:50:03 +00:00
|
|
|
|
fsm: support graceful osmo_fsm_inst_term() cascades
Add global flag osmo_fsm_term_safely() -- if set to true, enable the following
behavior:
Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term():
- collect deallocations until the outermost osmo_fsm_inst_term() is done.
- call osmo_fsm_inst_free() *after* dispatching the parent event.
If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already
within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent
it to a separate talloc context, to be deallocated with the outermost FSM inst.
The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term()
cascade will stay allocated until all osmo_fsm_inst_term() are complete and all
of them will be deallocated at the same time.
Mark the deferred deallocation state as __thread in an attempt to make cascaded
deallocation handling threadsafe. Keep the enable/disable flag separate, so
that it is global and not per-thread.
The feature is showcased by fsm_dealloc_test.c: with this feature, all of those
wild deallocation scenarios succeed.
Make fsm_dealloc_test a normal regression test in testsuite.at.
Rationale:
It is difficult to gracefully handle deallocations of groups of FSM instances
that reference each other. As soon as one child dispatching a cleanup event
causes its parent to deallocate before fsm.c was ready for it, deallocation
will hit a use-after-free. Before this patch, by using parent_term events and
distinct "terminating" FSM states, parent/child FSMs can be taught to wait for
all children to deallocate before deallocating the parent. But as soon as a
non-child / non-parent FSM instance is involved, or actually any other
cleanup() action that triggers parent FSMs or parent talloc contexts to become
unused, it is near impossible to think of all possible deallocation events
ricocheting, and to avoid running into freeing FSM instances that were still in
the middle of osmo_fsm_inst_term(), or FSM instances to enter
osmo_fsm_inst_term() more than once. This patch makes deallocation of "all
possible" setups of complex cross referencing FSM instances easy to handle
correctly, without running into use-after-free or double free situations, and,
notably, without changing calling code.
Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18
2019-03-24 04:56:21 +00:00
|
|
|
AT_SETUP([fsm_dealloc])
|
|
|
|
AT_KEYWORDS([fsm_dealloc])
|
|
|
|
cat $abs_srcdir/fsm/fsm_dealloc_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/fsm/fsm_dealloc_test], [0], [ignore], [experr])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2016-12-08 16:50:03 +00:00
|
|
|
AT_SETUP([oap])
|
|
|
|
AT_KEYWORDS([oap])
|
|
|
|
cat $abs_srcdir/oap/oap_test.ok > expout
|
|
|
|
touch experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/oap/oap_test], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
2017-01-27 09:29:49 +00:00
|
|
|
|
2018-07-30 16:14:45 +00:00
|
|
|
AT_SETUP([oap_client])
|
|
|
|
AT_KEYWORDS([oap_client])
|
|
|
|
cat $abs_srcdir/oap/oap_client_test.ok > expout
|
|
|
|
cat $abs_srcdir/oap/oap_client_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/oap/oap_client_test], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
2017-01-27 09:29:49 +00:00
|
|
|
AT_SETUP([socket])
|
|
|
|
AT_KEYWORDS([socket])
|
|
|
|
cat $abs_srcdir/socket/socket_test.ok > expout
|
|
|
|
cat $abs_srcdir/socket/socket_test.err > experr
|
|
|
|
touch experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/socket/socket_test], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
2017-03-15 00:52:58 +00:00
|
|
|
|
|
|
|
AT_SETUP([osmo-auc-gen])
|
|
|
|
AT_KEYWORDS([osmo-auc-gen])
|
|
|
|
cat $abs_srcdir/osmo-auc-gen/osmo-auc-gen_test.ok > expout
|
|
|
|
cat $abs_srcdir/osmo-auc-gen/osmo-auc-gen_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_srcdir/tests/osmo-auc-gen/osmo-auc-gen_test.sh $abs_top_builddir/utils/osmo-auc-gen], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
2017-05-15 10:07:51 +00:00
|
|
|
|
|
|
|
AT_SETUP([endian])
|
|
|
|
AT_KEYWORDS([endian])
|
|
|
|
cat $abs_srcdir/endian/endian_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/endian/endian_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2017-05-15 14:39:56 +00:00
|
|
|
|
|
|
|
AT_SETUP([sercomm])
|
|
|
|
AT_KEYWORDS([sercomm])
|
|
|
|
cat $abs_srcdir/sercomm/sercomm_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/sercomm/sercomm_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2017-06-18 15:16:02 +00:00
|
|
|
|
|
|
|
AT_SETUP([prbs])
|
|
|
|
AT_KEYWORDS([prbs])
|
|
|
|
cat $abs_srcdir/prbs/prbs_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/prbs/prbs_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2017-10-04 01:15:47 +00:00
|
|
|
|
|
|
|
AT_SETUP([gsm23003])
|
|
|
|
AT_KEYWORDS([gsm23003])
|
|
|
|
cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
add osmo_tdef API, originally adopted from osmo-bsc T_def
Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more
consistent. Upgrade to first class API:
- add timer grouping
- add generic vty support
- add mising API doc
- add C test
- add VTY transcript tests, also as examples for using the API
From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API.
The root reason for moving to libosmocore is that I want to use the
mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the
FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the
mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API
in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible
place for this.
osmo_tdef provides:
- a list of Tnnnn (GSM) timers with description, unit and default value.
- vty UI to allow users to configure non-default timeouts.
- API to tie T timers to osmo_fsm states and set them on state transitions.
- a few standard units (minute, second, millisecond) as well as a custom unit
(which relies on the timer's human readable description to indicate the
meaning of the value).
- conversion for standard units: for example, some GSM timers are defined in
minutes, while our FSM definitions need timeouts in seconds. Conversion is
for convenience only and can be easily avoided via the custom unit.
By keeping separate osmo_tdef arrays, several groups of timers can be kept
separately. The VTY tests in tests/tdef/ showcase different schemes:
- tests/vty/tdef_vty_test_config_root.c:
Keep several timer definitions in separately named groups: showcase the
osmo_tdef_vty_groups*() API. Each timer group exists exactly once.
- tests/vty/tdef_vty_test_config_subnode.c:
Keep a single list of timers without separate grouping.
Put this list on a specific subnode below the CONFIG_NODE.
There could be several separate subnodes with timers like this, i.e.
continuing from this example, sets timers could be separated by placing
timers in specific config subnodes instead of using the global group name.
- tests/vty/tdef_vty_test_dynamic.c:
Dynamically allocate timer definitions per each new created object.
Thus there can be an arbitrary number of independent timer definitions, one
per allocated object.
T_def was introduced during the recent osmo-bsc refactoring for inter-BSC
handover, and has proven useful:
- without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be
programmed with the right timeout value, for all code paths that invoke this
state change. It is a likely source of errors to get one of them wrong. By
defining a T timer exactly for an FSM state, the caller can merely invoke the
state change and trust on the original state definition to apply the correct
timeout.
- it is helpful to have a standardized config file UI to provide user
configurable timeouts, instead of inventing new VTY commands for each
separate application of T timer numbers.
Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
|
|
|
|
|
|
|
AT_SETUP([tdef])
|
|
|
|
AT_KEYWORDS([tdef])
|
|
|
|
cat $abs_srcdir/tdef/tdef_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/tdef/tdef_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2019-02-25 01:45:06 +00:00
|
|
|
|
|
|
|
AT_SETUP([sockaddr_str])
|
|
|
|
AT_KEYWORDS([sockaddr_str])
|
|
|
|
cat $abs_srcdir/sockaddr_str/sockaddr_str_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/sockaddr_str/sockaddr_str_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|
2019-02-11 19:32:25 +00:00
|
|
|
|
|
|
|
AT_SETUP([use_count])
|
|
|
|
AT_KEYWORDS([use_count])
|
|
|
|
cat $abs_srcdir/use_count/use_count_test.ok > expout
|
|
|
|
cat $abs_srcdir/use_count/use_count_test.err > experr
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/use_count/use_count_test], [0], [expout], [experr])
|
|
|
|
AT_CLEANUP
|
2019-03-18 16:17:43 +00:00
|
|
|
|
|
|
|
AT_SETUP([context])
|
|
|
|
AT_KEYWORDS([context])
|
|
|
|
cat $abs_srcdir/context/context_test.ok > expout
|
|
|
|
AT_CHECK([$abs_top_builddir/tests/context/context_test], [0], [expout], [ignore])
|
|
|
|
AT_CLEANUP
|