From 4d1f4fde4fb34f0fed559a0ee1518fcaeb3c743b Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 3 Sep 2024 12:30:25 +0200 Subject: [PATCH] pySim-prog_test: tolerate missing .data files When the test detects a card, but does not find the .data faile for it, then it fails. This can be a problem in case we want to intentionally exclude a specific card model. Related: OS#6532 Change-Id: Iba196ada0076385de7bffcb157a85fda0a6c1852 --- tests/pySim-prog_test/pySim-prog_test.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/pySim-prog_test/pySim-prog_test.sh b/tests/pySim-prog_test/pySim-prog_test.sh index e768d8f6..215ebeee 100755 --- a/tests/pySim-prog_test/pySim-prog_test.sh +++ b/tests/pySim-prog_test/pySim-prog_test.sh @@ -134,6 +134,11 @@ function gen_ok_files { continue fi echo "Card is of type: $CARD_NAME" + + if ! [ -r "$CARD_NAME.data" ]; then + echo "Warning: no .data file for this card, skipping..." + continue + fi gen_ok_file $I $CARD_NAME done } @@ -163,6 +168,11 @@ function run_test { ADM_HEX="" ADM_OPT="-a" + if ! [ -r "$CARD_NAME.data" ]; then + echo "Warning: no .data file for this card, skipping..." + continue + fi + source "$CARD_NAME.data" if [ -n "$ADM_HEX" ]; then ADM_OPT="-A"