laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/38005?usp=email )

Change subject: pySim-prog_test: tolerate empty reader slots
......................................................................

pySim-prog_test: tolerate empty reader slots

The test currently expects all reader slots to be populated. This means
the cards may plugged into a random order, but there may not be any empty
slots in the system at all. This requirement is easy to meet when each
card has its own single-slot USB PCSC-reader, but as soon as multislot
readers are used there may be some empty slots.

Related: OS#6532
Change-Id: I7ba1d1350b6998d65e90408184accdb212556a7c
---
M tests/pySim-prog_test/pySim-prog_test.sh
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/tests/pySim-prog_test/pySim-prog_test.sh 
b/tests/pySim-prog_test/pySim-prog_test.sh
index 173822a..e768d8f 100755
--- a/tests/pySim-prog_test/pySim-prog_test.sh
+++ b/tests/pySim-prog_test/pySim-prog_test.sh
@@ -130,8 +130,8 @@
        echo "Probing card in terminal #$I"
        CARD_NAME=$(probe_card $I)
        if [ -z "$CARD_NAME" ]; then
-           echo "Error: Unresponsive card!"
-           exit 1
+           echo "Warning: Unresponsive card!"
+           continue
        fi
        echo "Card is of type: $CARD_NAME"
        gen_ok_file $I $CARD_NAME
@@ -146,8 +146,8 @@
        echo "Probing card in terminal #$I"
        CARD_NAME=$(probe_card $I)
        if [ -z "$CARD_NAME" ]; then
-           echo "Error: Unresponsive card!"
-           exit 1
+           echo "Warning: Unresponsive card, trying next terminal..."
+           continue
        fi
        echo "Card is of type: $CARD_NAME"

@@ -216,7 +216,8 @@
 # then the number of cards will be used as reader number.
 gen_card_list
 if [ $N_TERMINALS -eq 0 ]; then
-    N_TERMINALS=$N_CARDS
+    N_TERMINALS=`pcsc_scan -r | sed '$!d' | cut -d ':' -f 1`
+    ((N_TERMINALS++))
 fi
 echo "Number of card terminals installed: $N_TERMINALS"
 echo ""

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38005?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7ba1d1350b6998d65e90408184accdb212556a7c
Gerrit-Change-Number: 38005
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>

Reply via email to