mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-18 19:38:34 +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/navigate_fs/__init__.py
Normal file
0
tests/pySim-shell_test/navigate_fs/__init__.py
Normal file
3
tests/pySim-shell_test/navigate_fs/checkpoints_sim.ok
Normal file
3
tests/pySim-shell_test/navigate_fs/checkpoints_sim.ok
Normal file
@@ -0,0 +1,3 @@
|
||||
currently selected file: MF/DF.GSM/EF.IMSI (3f00/7f20/6f07)
|
||||
currently selected file: MF/DF.TELECOM/EF.MSISDN (3f00/7f10/6f40)
|
||||
currently selected file: MF/DF.GSM (3f00/7f20)
|
||||
16
tests/pySim-shell_test/navigate_fs/checkpoints_uicc.ok
Normal file
16
tests/pySim-shell_test/navigate_fs/checkpoints_uicc.ok
Normal file
@@ -0,0 +1,16 @@
|
||||
currently selected file: MF/ADF.USIM/EF.IMSI (3f00/a0000000871002/6f07)
|
||||
currently selected file: MF/ADF.ISIM/EF.AD (3f00/a0000000871004/6fad)
|
||||
currently selected file: MF/ADF.ARA-M (3f00/a00000015141434c00)
|
||||
currently selected file: MF (3f00)
|
||||
currently selected file: MF/ADF.USIM/EF.IMSI (3f00/a0000000871002/6f07)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
currently selected file: MF/ADF.USIM/EF.IMSI (3f00/a0000000871002/6f07)
|
||||
currently selected file: MF/ADF.USIM/EF.AD (3f00/a0000000871002/6fad)
|
||||
currently selected file: MF/ADF.ARA-M (3f00/a00000015141434c00)
|
||||
currently selected file: MF (3f00)
|
||||
currently selected file: MF/ADF.USIM/EF.IMSI (3f00/a0000000871002/6f07)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
currently selected file: MF/DF.TELECOM/DF.MCS/EF.MST (3f00/7f10/5f3d/4f01)
|
||||
40
tests/pySim-shell_test/navigate_fs/test.py
Normal file
40
tests/pySim-shell_test/navigate_fs/test.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# 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_uicc(self):
|
||||
cardname = 'sysmoISIM-SJA5-S17'
|
||||
|
||||
self.runPySimShell(cardname, "test_uicc.script")
|
||||
self.assertEqualFiles("checkpoints_uicc.tmp")
|
||||
|
||||
def test_sim(self):
|
||||
# This test is to make sure that we still can navigate classic SIM cards
|
||||
cardname = 'sysmoSIM-GR1'
|
||||
|
||||
self.runPySimShell(cardname, "test_sim.script")
|
||||
self.assertEqualFiles("checkpoints_sim.tmp")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
16
tests/pySim-shell_test/navigate_fs/test_sim.script
Normal file
16
tests/pySim-shell_test/navigate_fs/test_sim.script
Normal file
@@ -0,0 +1,16 @@
|
||||
set debug true
|
||||
set echo true
|
||||
|
||||
select DF.GSM
|
||||
select EF.IMSI
|
||||
select > checkpoints_sim.tmp
|
||||
|
||||
select MF
|
||||
select DF.TELECOM
|
||||
select EF.MSISDN
|
||||
select >> checkpoints_sim.tmp
|
||||
|
||||
select MF
|
||||
select EF.ICCID
|
||||
select DF.GSM
|
||||
select >> checkpoints_sim.tmp
|
||||
68
tests/pySim-shell_test/navigate_fs/test_uicc.script
Normal file
68
tests/pySim-shell_test/navigate_fs/test_uicc.script
Normal file
@@ -0,0 +1,68 @@
|
||||
set debug true
|
||||
set echo true
|
||||
|
||||
# Navigate using filenames
|
||||
|
||||
select ADF.USIM
|
||||
select EF.IMSI
|
||||
select > checkpoints_uicc.tmp
|
||||
|
||||
select ADF.ISIM
|
||||
select EF.AD
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.ARA-M
|
||||
select >> checkpoints_uicc.tmp
|
||||
select MF
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.USIM/EF.IMSI
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.USIM
|
||||
select DF.5GS
|
||||
select ../../DF.TELECOM/DF.MCS/EF.MST
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.USIM
|
||||
select DF.5GS
|
||||
select /DF.TELECOM/DF.MCS/EF.MST
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.USIM
|
||||
select DF.5GS
|
||||
select /DF.TELECOM/../DF.TELECOM/DF.MCS/EF.MST
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
# Navigate using FIDs
|
||||
|
||||
select a0000000871002
|
||||
select 6f07
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select a0000000871002
|
||||
select 6fad
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select a00000015141434c00
|
||||
select >> checkpoints_uicc.tmp
|
||||
select 3f00
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select ADF.USIM/EF.IMSI
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select a0000000871002
|
||||
select 5fc0
|
||||
select ../../7f10/5f3d/4f01
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select a0000000871002
|
||||
select 5fc0
|
||||
select 3f00/7f10/5f3d/4f01
|
||||
select >> checkpoints_uicc.tmp
|
||||
|
||||
select a0000000871002
|
||||
select 5fc0
|
||||
select 3f00/7f10/../7f10/5f3d/4f01
|
||||
select >> checkpoints_uicc.tmp
|
||||
Reference in New Issue
Block a user