mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-19 20:08:36 +03:00
Add testsuite for pySim-shell with real cards
This patch adds a comprehensive testsuite for pySim-shell. The testsuite is based on python's unittest framework in combination with pySim-shell scripts. Related: OS#6531 Change-Id: Ieae1330767a6e55e62437f5f988a0d33b727b5de
This commit is contained in:
0
tests/pySim-shell_test/cardinfo/__init__.py
Normal file
0
tests/pySim-shell_test/cardinfo/__init__.py
Normal file
13
tests/pySim-shell_test/cardinfo/sysmoEUICC1-C2T-cardinfo.ok
Normal file
13
tests/pySim-shell_test/cardinfo/sysmoEUICC1-C2T-cardinfo.ok
Normal file
@@ -0,0 +1,13 @@
|
||||
Card info:
|
||||
Name: UICC
|
||||
ATR: 3b9f96803f87828031e073fe211f574543753130136502
|
||||
EID: 89049044900000000000000000102355
|
||||
ICCID: 89000123456789012341
|
||||
Class-Byte: 00
|
||||
Select-Ctrl: 0004
|
||||
AIDs:
|
||||
a0000000871002
|
||||
a0000000871004
|
||||
a0000005591010ffffffff8900000200
|
||||
a0000005591010ffffffff8900000100
|
||||
a00000015141434c00
|
||||
11
tests/pySim-shell_test/cardinfo/sysmoISIM-SJA2-cardinfo.ok
Normal file
11
tests/pySim-shell_test/cardinfo/sysmoISIM-SJA2-cardinfo.ok
Normal file
@@ -0,0 +1,11 @@
|
||||
Card info:
|
||||
Name: UICC
|
||||
ATR: 3b9f96801f878031e073fe211b674a4c753034054ba9
|
||||
ICCID: 8988211000000467343
|
||||
Class-Byte: 00
|
||||
Select-Ctrl: 0004
|
||||
AIDs:
|
||||
a0000000871002
|
||||
a0000000871004
|
||||
a000000003000000
|
||||
a00000015141434c00
|
||||
@@ -0,0 +1,11 @@
|
||||
Card info:
|
||||
Name: UICC
|
||||
ATR: 3b9f96801f878031e073fe211b674a357530350265f8
|
||||
ICCID: 8949440000001155314
|
||||
Class-Byte: 00
|
||||
Select-Ctrl: 0004
|
||||
AIDs:
|
||||
a0000000871002
|
||||
a0000000871004
|
||||
a000000003000000
|
||||
a00000015141434c00
|
||||
6
tests/pySim-shell_test/cardinfo/sysmoSIM-GR1-cardinfo.ok
Normal file
6
tests/pySim-shell_test/cardinfo/sysmoSIM-GR1-cardinfo.ok
Normal file
@@ -0,0 +1,6 @@
|
||||
Card info:
|
||||
Name: SIM
|
||||
ATR: 3b991800118822334455667760
|
||||
ICCID: 2222334455667788990
|
||||
Class-Byte: a0
|
||||
Select-Ctrl: 0000
|
||||
36
tests/pySim-shell_test/cardinfo/test.py
Normal file
36
tests/pySim-shell_test/cardinfo/test.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Testsuite for pySim-shell.py
|
||||
#
|
||||
# (C) 2024 by sysmocom - s.f.m.c. GmbH
|
||||
# All Rights Reserved
|
||||
#
|
||||
# Author: Philipp Maier
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import unittest
|
||||
import os
|
||||
from utils import *
|
||||
|
||||
class test_case(UnittestUtils):
|
||||
|
||||
def test(self):
|
||||
for cardname in self.cards:
|
||||
self.equipTemplate("test.script", CARDNAME=cardname)
|
||||
self.runPySimShell(cardname, "test.script")
|
||||
self.assertEqualFiles(cardname + "-cardinfo.tmp",
|
||||
mask_regex_list = [' [A-Fa-f0-9]*$'],
|
||||
interesting_regex_list = ['^ a0.*', '^ ATR.*', '^ Cla.*', '^ Sel.*'])
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
5
tests/pySim-shell_test/cardinfo/test.template
Normal file
5
tests/pySim-shell_test/cardinfo/test.template
Normal file
@@ -0,0 +1,5 @@
|
||||
set debug true
|
||||
set echo true
|
||||
|
||||
# Export the entire file system
|
||||
cardinfo > $CARDNAME-cardinfo.tmp
|
||||
Reference in New Issue
Block a user