add osmo-auc-gen_test

Add test for osmo-auc-gen invocations to ensure stability across upcoming SQN
increment scheme changes.

The test comprises of a shell script that invokes the osmo-auc-gen binary with
various milenage parameters, of which the stdout/stderr are verified.

More osmo-auc-gen invocations could be added, but my main focus is on the SEQ
changes. Instead of manually testing that it still works for each SQN patch, I
want this test to do it for me.

To make sure that osmo-auc-gen is build before the tests are launched, place
'utils' before 'tests' in the root Makefile.am.

Related: OS#1968
Change-Id: Ib4af34201cd2e7d76037bcd31dd89ef18c1a9aec
changes/77/2077/4
Neels Hofmeyr 6 years ago committed by Harald Welte
parent 8e1b598c8a
commit d3b58730d5
  1. 2
      Makefile.am
  2. 5
      tests/Makefile.am
  3. 0
      tests/osmo-auc-gen/osmo-auc-gen_test.err
  4. 92
      tests/osmo-auc-gen/osmo-auc-gen_test.ok
  5. 30
      tests/osmo-auc-gen/osmo-auc-gen_test.sh
  6. 7
      tests/testsuite.at

@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim tests utils
SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim utils tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \

@ -192,7 +192,10 @@ EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \
gsup/gsup_test.ok gsup/gsup_test.err \
oap/oap_test.ok fsm/fsm_test.ok fsm/fsm_test.err \
write_queue/wqueue_test.ok socket/socket_test.ok \
socket/socket_test.err coding/coding_test.ok
socket/socket_test.err coding/coding_test.ok \
osmo-auc-gen/osmo-auc-gen_test.sh \
osmo-auc-gen/osmo-auc-gen_test.ok \
osmo-auc-gen/osmo-auc-gen_test.err
DISTCLEANFILES = atconfig atlocal
noinst_HEADERS = conv/conv.h

@ -0,0 +1,92 @@
> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 0
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 6a61050765caa32c90371370e5d6dc2d
AUTN: 790c5d80c47b0000716ce00883bc39e1
IK: 6cf555588bb61ab2ff23cd333c05ed09
CK: f0b29f50a7d873f30336473bdc35d04f
RES: f511d3a7f06e6a30
SRES: 057fb997
Kc: 60524000cc5e5407
> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 1
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 6a61050765caa32c90371370e5d6dc2d
AUTN: 790c5d80c47a000058508ab3864e26a0
IK: 6cf555588bb61ab2ff23cd333c05ed09
CK: f0b29f50a7d873f30336473bdc35d04f
RES: f511d3a7f06e6a30
SRES: 057fb997
Kc: 60524000cc5e5407
> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 23
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 6a61050765caa32c90371370e5d6dc2d
AUTN: 790c5d80c46c0000e74d796ec095dbee
IK: 6cf555588bb61ab2ff23cd333c05ed09
CK: f0b29f50a7d873f30336473bdc35d04f
RES: f511d3a7f06e6a30
SRES: 057fb997
Kc: 60524000cc5e5407
> osmo-auc-gen -3 -a milenage -r 1dc4f974325cce611e54f516dc1fec56 -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 6a61050765caa32c90371370e5d6dc2d -s 42
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 1dc4f974325cce611e54f516dc1fec56
AUTN: 434a46a71aeb0000fedc563f27a0916c
IK: d7213dd74860ccb8c14e54c0c4abc91c
CK: c350653d72f7a5bac3a27422e5186019
RES: 912cdfaadd7b0154
SRES: 4c57defe
Kc: 169d78081b24c007
> osmo-auc-gen -3 -a milenage -r 2a48162ff3edca4adf0b7b5e527d6c16 -k 6a61050765caa32c90371370e5d6dc2d -o 1dc4f974325cce611e54f516dc1fec56 -s 99
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 2a48162ff3edca4adf0b7b5e527d6c16
AUTN: bfbf3332c91e0000d6199cad31d15f26
IK: 191a93c4396113bff6939d4f98e169a6
CK: 9c38d9089265ed5ea164e190a65c200d
RES: fd40205be2c9c7b2
SRES: 1f89e7e9
Kc: d2d5361395b9b74a
> osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 1dc4f974325cce611e54f516dc1fec56 -s 281474976710655
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 6a61050765caa32c90371370e5d6dc2d
AUTN: afb993e4f4b8000069cdeebb4a4b5b58
IK: c348c2fe2f3e1fb37a7ae1638163bd98
CK: e740c156278705a14e1a99ba6d31334f
RES: 7c04e86a67967fcd
SRES: 1b9297a7
Kc: 10687b71e4eb94c5
> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c
osmo-auc-gen (C) 2011-2012 by Harald Welte
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
RAND: 39fa2f4e3d523d8619a73b4f65c3e14d
AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180
IK: 27497388b6cb044648f396aa155b95ef
CK: f64735036e5871319c679f4742a75ea1
RES: e229c19e791f2e41
SRES: 9b36efdf
Kc: 059a4f668f6fbe39
AUTS success: SQN.MS = 23, generated vector with SQN = 24, next SQN = 25

@ -0,0 +1,30 @@
#!/bin/sh
osmo_auc_gen="$1"
set -e
# run the osmo-auc-gen binary verbosely without showing its absolute path
# for identical expected output everywhere.
invoke() {
echo
echo
echo '>' osmo-auc-gen $@
$osmo_auc_gen $@
}
bytes1="6a61050765caa32c90371370e5d6dc2d"
bytes2="1dc4f974325cce611e54f516dc1fec56"
bytes3="2a48162ff3edca4adf0b7b5e527d6c16"
invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 0
invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 1
invoke -3 -a milenage -r $bytes1 -k $bytes2 -o $bytes3 -s 23
invoke -3 -a milenage -r $bytes2 -k $bytes3 -o $bytes1 -s 42
invoke -3 -a milenage -r $bytes3 -k $bytes1 -o $bytes2 -s 99
invoke -3 -a milenage -r $bytes1 -k $bytes3 -o $bytes2 -s 281474976710655
k="EB215756028D60E3275E613320AEC880"
opc="FB2A3D1B360F599ABAB99DB8669F8308"
rand="39fa2f4e3d523d8619a73b4f65c3e14d"
auts="979498b1f72d3e28c59fa2e72f9c"
invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts

@ -249,3 +249,10 @@ cat $abs_srcdir/socket/socket_test.err > experr
touch experr
AT_CHECK([$abs_top_builddir/tests/socket/socket_test], [0], [expout], [experr])
AT_CLEANUP
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

Loading…
Cancel
Save