mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48: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:
33
tests/pySim-shell_test/file_content/test_binary_uicc.script
Normal file
33
tests/pySim-shell_test/file_content/test_binary_uicc.script
Normal file
@@ -0,0 +1,33 @@
|
||||
set debug true
|
||||
set echo true
|
||||
|
||||
# Create a backup the files we will modify
|
||||
export --filename MF/ADF.USIM/EF.LOCI > restore_ef_loci.script.tmp
|
||||
|
||||
# Select an arbitrary file to work with
|
||||
select MF/ADF.USIM/EF.LOCI
|
||||
|
||||
# Clear file contents
|
||||
update_binary ffffffffffffffffffffff
|
||||
read_binary > test_binary_uicc.tmp
|
||||
|
||||
# Write some short pattern to the file
|
||||
update_binary 01234567890abcdeff
|
||||
read_binary >> test_binary_uicc.tmp
|
||||
|
||||
# Write some pattern to the file
|
||||
update_binary 01234567890abcdeffaaaa
|
||||
read_binary >> test_binary_uicc.tmp
|
||||
|
||||
# Write some short pattern to the file, we expect the tail to remain unchanged
|
||||
update_binary 001abcd344
|
||||
read_binary >> test_binary_uicc.tmp
|
||||
|
||||
# Write some json encoded content to the file
|
||||
update_binary_decoded '{"tmsi": "12345678", "lai": { "mcc_mnc": "262-42", "lac": "9876" }, "rfu": 0, "lu_status": 1 }'
|
||||
|
||||
# Read the file, we expect the same json encoded content to show up again.
|
||||
read_binary_decoded >> test_binary_uicc.tmp
|
||||
|
||||
# Restore modified files to their original state
|
||||
run_script restore_ef_loci.script.tmp
|
||||
Reference in New Issue
Block a user