diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-15 01:52:58 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-03-15 12:46:08 +0000 |
commit | d3b58730d5c86db96ee51e458ad35596617bebe9 (patch) | |
tree | aab9f300850dc5e376617ba13853f4f3f037a16d /tests/osmo-auc-gen/osmo-auc-gen_test.sh | |
parent | 8e1b598c8ae408f0dd15a4460920a4d82eb05a27 (diff) |
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
Diffstat (limited to 'tests/osmo-auc-gen/osmo-auc-gen_test.sh')
-rwxr-xr-x | tests/osmo-auc-gen/osmo-auc-gen_test.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh new file mode 100755 index 00000000..7842638a --- /dev/null +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -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 |