2017-02-24 12:59:14 +00:00
|
|
|
Checking ctrl types...
|
ctrl_type_vals: explicitly terminate
Don't use CTRL_TYPE_UNKNOWN as value_string[] terminator, use an explicit, more
obvious { 0, NULL } termination. Set an explicit string for CTRL_TYPE_UNKNOWN.
No other value_string[]s to date have such a "hidden" terminator.
BTW, a { 0, "string" } item is not a terminator, only { 0, NULL } is, so we can
set a string for CTRL_TYPE_UNKNOWN == 0.
Also, having a string value for CTRL_TYPE_UNKNOWN is not harmful because all
code paths explicitly check for the CTRL_TYPE_*s that are valid.
Adjust the test expectation.
From the ctrl_type_vals enum, remove the = 0, because it is implicitly 0
anyway.
One motivation to press this fixup: I am trying to add a script that checks
whether all value_string[]s are terminated to our jenkins jobs, and to find
that this one is terminated, it would need to interpret the CTRL_TYPE_UNKNOWN
constant, which would make things far more complex. At this point, all of the
value_string[]s have an explicit termination, and I would like to enforce this
from now on -- for readable code and to not spend more time on the validator.
The patch adding ctrl_type_vals (Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28) was
accepted by another reviewer before I could reconfirm my -1, so this is a fixup
to enable the termination checking script patches.
Related: I2bc93ab4781487e7685cfb63091a489cd126b1a8 (adds script to libosmocore)
I7fe3678b524d602fc6aa14bc0ed06308df809a3e (uses in jenkins.sh)
Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28 (adds ctrl_type_vals)
Change-Id: Ia99f37464c7b36b587da2cc78f52c82725f02cbc
2017-03-02 13:32:52 +00:00
|
|
|
ctrl type 0 is (unknown) -> 0 OK
|
2017-02-24 12:59:14 +00:00
|
|
|
ctrl type 1 is GET -> 1 OK
|
|
|
|
ctrl type 2 is SET -> 2 OK
|
|
|
|
ctrl type 3 is GET_REPLY -> 3 OK
|
|
|
|
ctrl type 4 is SET_REPLY -> 4 OK
|
|
|
|
ctrl type 5 is TRAP -> 5 OK
|
|
|
|
ctrl type 6 is ERROR -> 6 OK
|
|
|
|
ctrl type 64 is unknown 0x40 [PARSE FAILED]
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'GET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
2017-12-16 00:03:37 +00:00
|
|
|
value = '(null)'
|
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'GET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
variable = 'variable'
|
2017-12-16 00:03:37 +00:00
|
|
|
value = '(null)'
|
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 var\ni\nable'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET with trailing characters'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET with trailing characters'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-15 19:41:28 +00:00
|
|
|
test: 'GET 1 var\ti\table'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-12-15 19:41:28 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET variable contains invalid characters'
|
2017-12-15 19:41:28 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET variable contains invalid characters'
|
2017-12-15 19:41:28 +00:00
|
|
|
ok
|
|
|
|
test: 'GET 1 var\ri\rable'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-12-15 19:41:28 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET variable contains invalid characters'
|
2017-12-15 19:41:28 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET variable contains invalid characters'
|
2017-12-15 19:41:28 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable value'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET with trailing characters'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET with trailing characters'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable value\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET with trailing characters'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET with trailing characters'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable multiple value tokens'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET with trailing characters'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET with trailing characters'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'GET 1 variable multiple value tokens\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
2017-09-26 12:21:44 +00:00
|
|
|
reply = 'GET with trailing characters'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR 1 GET with trailing characters'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable value'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'value'
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable value\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'value'
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET weird_id variable value'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 12:21:44 +00:00
|
|
|
id = 'err'
|
|
|
|
reply = 'Invalid message ID number'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR err Invalid message ID number'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET weird_id variable value\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 12:21:44 +00:00
|
|
|
id = 'err'
|
|
|
|
reply = 'Invalid message ID number'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR err Invalid message ID number'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable multiple value tokens'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'multiple value tokens'
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable multiple value tokens\n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'multiple value tokens'
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable value_with_trailing_spaces '
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'value_with_trailing_spaces '
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET 1 variable value_with_trailing_spaces \n'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET'
|
2017-09-26 13:24:58 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = 'value_with_trailing_spaces '
|
2017-12-16 00:03:37 +00:00
|
|
|
reply = '(null)'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
|
|
|
replied: 'ERROR 1 Command not found'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET \n special_char_id value'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 12:21:44 +00:00
|
|
|
id = 'err'
|
|
|
|
reply = 'Invalid message ID number'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR err Invalid message ID number'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 04:38:37 +00:00
|
|
|
test: 'SET \t special_char_id value'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'ERROR' (parse failure)
|
2017-09-26 12:21:44 +00:00
|
|
|
id = 'err'
|
|
|
|
reply = 'Invalid message ID number'
|
2017-12-16 04:38:37 +00:00
|
|
|
handling:
|
2017-09-26 12:21:44 +00:00
|
|
|
replied: 'ERROR err Invalid message ID number'
|
2017-09-26 13:24:58 +00:00
|
|
|
ok
|
2017-12-16 03:01:54 +00:00
|
|
|
test: 'GET_REPLY 1 variable OK'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'GET_REPLY'
|
2017-12-16 03:01:54 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = '(null)'
|
|
|
|
reply = 'OK'
|
|
|
|
handling:
|
|
|
|
ok
|
|
|
|
test: 'SET_REPLY 1 variable OK'
|
|
|
|
parsing:
|
2018-07-12 17:29:23 +00:00
|
|
|
type = 'SET_REPLY'
|
2017-12-16 03:01:54 +00:00
|
|
|
id = '1'
|
|
|
|
variable = 'variable'
|
|
|
|
value = '(null)'
|
|
|
|
reply = 'OK'
|
|
|
|
handling:
|
|
|
|
ok
|
2018-07-12 17:29:23 +00:00
|
|
|
test: 'ERROR 1 some error message'
|
|
|
|
parsing:
|
|
|
|
type = 'ERROR' (error received)
|
|
|
|
id = '1'
|
|
|
|
reply = 'some error message'
|
|
|
|
handling:
|
|
|
|
ok
|
|
|
|
test: 'ERROR err some error message'
|
|
|
|
parsing:
|
|
|
|
type = 'ERROR' (error received)
|
|
|
|
id = 'err'
|
|
|
|
reply = 'some error message'
|
|
|
|
handling:
|
|
|
|
ok
|
2018-04-05 00:14:12 +00:00
|
|
|
|
|
|
|
test_deferred_cmd
|
|
|
|
get_test_defer called
|
|
|
|
ctrl_handle_msg() returned 0
|
2018-04-03 14:51:49 +00:00
|
|
|
invoking ctrl_test_defer_cb() asynchronously
|
|
|
|
ctrl_test_defer_cb called
|
2018-04-05 00:14:12 +00:00
|
|
|
success
|