Add testsuite

The idea of the testsuite is to test all functions of the utility
against one known SIM card that is inserted at the time the test
is executed.

We could insert this card into a reader attached to a
permanently-running machine and then use that as a jenkins build
test slave.
This commit is contained in:
Harald Welte 2017-08-16 23:02:09 +02:00
parent 7660d07aa9
commit 5140557f3b
18 changed files with 1281 additions and 0 deletions

16
tests/01_auth.out Normal file
View File

@ -0,0 +1,16 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Done!

4
tests/01_auth.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. ./test-data
$TOOL -a $ADMPIN

23
tests/02_mode_read.out Normal file
View File

@ -0,0 +1,23 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading SIM-Mode...
* Initalizing...
* Reading...
* Current status of Record No. 1 in EF.DIR:
61194f10a0000000871002ffffffff890709000050055553696d31ffffffffffffffffffffff
==> USIM application enabled
Done!

4
tests/02_mode_read.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. ./test-data
$TOOL -a $ADMPIN -m

92
tests/03_mode_write.out Normal file
View File

@ -0,0 +1,92 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming SIM-Mode...
* New status of Record No.1 in EF.DIR:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
==> USIM application disabled
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: None
Reading SIM-Mode...
* Initalizing...
* Reading...
* Current status of Record No. 1 in EF.DIR:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
==> USIM application disabled
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: None
Programming SIM-Mode...
* New status of Record No.1 in EF.DIR:
61194f10a0000000871002ffffffff890709000050055553696d31ffffffffffffffffffffff
==> USIM application enabled
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading SIM-Mode...
* Initalizing...
* Reading...
* Current status of Record No. 1 in EF.DIR:
61194f10a0000000871002ffffffff890709000050055553696d31ffffffffffffffffffffff
==> USIM application enabled
Done!

7
tests/03_mode_write.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
. ./test-data
$TOOL -a $ADMPIN -c
$TOOL -a $ADMPIN -m
$TOOL -a $ADMPIN -u
$TOOL -a $ADMPIN -m

782
tests/04_algo.out Normal file
View File

@ -0,0 +1,782 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: MILENAGE
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: MILENAGE
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v1
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v1
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: XOR-2G
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: XOR-2G
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: GBA
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: GBA
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v2
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v2
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v3
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v3
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: CIS-B
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: CIS-B
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: GBA
3G: XOR-3G
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: GBA
3G: XOR-3G
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v1
3G: XOR-3G
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v1
3G: XOR-3G
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: MILENAGE
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: MILENAGE
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v1
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v1
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: XOR-2G
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: XOR-2G
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v2
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v2
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v3
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v3
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: CIS-B
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: CIS-B
3G: MILENAGE
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: GBA
3G: XOR-3G
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: GBA
3G: XOR-3G
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Programming Authentication parameters...
* New algorithm setting:
2G: COMP128v1
3G: MILENAGE
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Authentication parameters...
* Initalizing...
* Reading...
* Current algorithm setting:
2G: COMP128v1
3G: MILENAGE
Done!

9
tests/04_algo.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
. ./test-data
ALGOS="1:1 3:1 4:1 5:1 6:1 7:1 9:1 5:8 3:8 "
ALGOS+="MILENAGE:MILENAGE COMP128v1:MILENAGE XOR-2G:MILENAGE COMP128v2:MILENAGE COMP128v3:MILENAGE CIS-B:MILENAGE GBA:XOR-3G COMP128v1:MILENAGE"
for algo in $ALGOS; do
$TOOL -a $ADMPIN -T $algo
$TOOL -a $ADMPIN -t
done

31
tests/05_milenage_par.out Normal file
View File

@ -0,0 +1,31 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Milenage parameters...
* Initalizing...
* Reading...
* Current Milenage Parameters in (EF.MLNGC):
C1: 00000000000000000000000000000000
C2: 00000000000000000000000000000001
C3: 00000000000000000000000000000002
C4: 00000000000000000000000000000004
C5: 00000000000000000000000000000008
R1: 0x40
R2: 0x0
R3: 0x20
R4: 0x40
R5: 0x60
Done!

5
tests/05_milenage_par.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. ./test-data
# we only test reading here
$TOOL -a $ADMPIN -l

90
tests/06_op_opc.out Normal file
View File

@ -0,0 +1,90 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Writing OPC value...
* New OPc setting:
OPc: 000102030405060708090a0b0c0d0e0f
OP/OPc: 000102030405060708090a0b0c0d0e0f
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading OP/C value...
* Initalizing...
* Reading...
* Current OP/OPc setting:
OPc: 000102030405060708090a0b0c0d0e0f
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Writing OP value...
* New OPc setting:
OP: 840337c3d45397ce8ea8609ffdc47224
OP/OPc: 840337c3d45397ce8ea8609ffdc47224
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading OP/C value...
* Initalizing...
* Reading...
* Current OP/OPc setting:
OP: 840337c3d45397ce8ea8609ffdc47224
Done!

9
tests/06_op_opc.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
. ./test-data
$TOOL -a $ADMPIN -C 000102030405060708090a0b0c0d0e0f
$TOOL -a $ADMPIN -o
$TOOL -a $ADMPIN -O 840337c3d45397ce8ea8609ffdc47224
$TOOL -a $ADMPIN -o

88
tests/07_ki.out Normal file
View File

@ -0,0 +1,88 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Writing KI value...
* New KI setting:
KI: a0b1c2d3e4f5061728394a5b6c7d8e9f
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading KI value...
* Initalizing...
* Reading...
* Current KI setting:
KI: a0b1c2d3e4f5061728394a5b6c7d8e9f
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Writing KI value...
* New KI setting:
KI: 94c7f52c8c7337fad1af3a73b17b56ac
* Initalizing...
* Programming...
Done!
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading KI value...
* Initalizing...
* Reading...
* Current KI setting:
KI: 94c7f52c8c7337fad1af3a73b17b56ac
Done!

11
tests/07_ki.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
. ./test-data
# set to arbitrary value + read back
$TOOL -a $ADMPIN -K a0b1c2d3e4f5061728394a5b6c7d8e9f
$TOOL -a $ADMPIN -k
# set to original value + read back
$TOOL -a $ADMPIN -K $KI
$TOOL -a $ADMPIN -k

63
tests/08_seq.out Normal file
View File

@ -0,0 +1,63 @@
sysmoUSIM-SJS1 parameterization tool
Copyright (c)2017 Sysmocom s.f.m.c. GmbH
Initializing smartcard terminal...
Detected Card ICCID: 8988211320300000028
Authenticating...
* Remaining attempts: 3
* Authenticating...
* Authentication successful
* Remaining attempts: 3
Detected Card IMSI: 262423203000002
Reading Milenage Sequence parameters...
* Initalizing...
* Current SQN Configuration:
IND (bits): 5
SQN Check enabled: 0
SQN Age Limit enabled: 1
SQN Max Delta enabled: 0
SQNms Offset: 0
Max Delta: 268435456
Age Limit: 268435456
* Current SQN Array:
SEQ[000]: 0
SEQ[001]: 0
SEQ[002]: 0
SEQ[003]: 0
SEQ[004]: 0
SEQ[005]: 0
SEQ[006]: 0
SEQ[007]: 0
SEQ[008]: 0
SEQ[009]: 0
SEQ[010]: 0
SEQ[011]: 0
SEQ[012]: 0
SEQ[013]: 0
SEQ[014]: 0
SEQ[015]: 0
SEQ[016]: 0
SEQ[017]: 0
SEQ[018]: 0
SEQ[019]: 0
SEQ[020]: 0
SEQ[021]: 0
SEQ[022]: 0
SEQ[023]: 0
SEQ[024]: 0
SEQ[025]: 0
SEQ[026]: 0
SEQ[027]: 0
SEQ[028]: 0
SEQ[029]: 0
SEQ[030]: 0
SEQ[031]: 0
* Authentication Counter: DISABLED
Done!

5
tests/08_seq.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. ./test-data
# we can only read them for now, which will of course change once we perform auth against it
$TOOL -a $ADMPIN -s

36
tests/run-tests Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
# default: execute all tests
TESTS="01_auth.sh 02_mode_read.sh 03_mode_write.sh 04_algo.sh 05_milenage_par.sh 06_op_opc.sh 07_ki.sh 08_seq.sh"
# if command line specifies some specific tests, execute only those
if [ $# -ge 1 ]; then
TESTS=$*
fi
TMP=`tempfile`
NUM_FAIL=0
for T in $TESTS; do
echo "==> Executing Testcase $T"
EXPOUT=${T%%.sh}.out
rm $TMP
./$T > $TMP
diff -u $EXPOUT $TMP
if [ $? == 0 ]; then
echo "Test $T passed"
else
echo "Test $T FAILED!"
NUM_FAIL=$((NUM_FAIL+1))
fi
done
echo
echo
echo "Summary: $NUM_FAIL Tests failed"
if [ $NUM_FAIL -gt 0 ]; then
exit 1
else
exit 0
fi

6
tests/test-data Normal file
View File

@ -0,0 +1,6 @@
TOOL=../sysmo-usim-tool.sjs1.py
# data for the test scripts. The values have to match the SIM card inserted while executing the test
ICCID=8988211320300000028
IMSI=262423203000002
ADMPIN=53304155
KI=94c7f52c8c7337fad1af3a73b17b56ac