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
This commit is contained in:
Philipp Maier
2024-09-03 12:04:32 +02:00
parent f0034e4fe8
commit 33256ddfed

View File

@@ -130,8 +130,8 @@ function gen_ok_files {
echo "Probing card in terminal #$I" echo "Probing card in terminal #$I"
CARD_NAME=$(probe_card $I) CARD_NAME=$(probe_card $I)
if [ -z "$CARD_NAME" ]; then if [ -z "$CARD_NAME" ]; then
echo "Error: Unresponsive card!" echo "Warning: Unresponsive card!"
exit 1 continue
fi fi
echo "Card is of type: $CARD_NAME" echo "Card is of type: $CARD_NAME"
gen_ok_file $I $CARD_NAME gen_ok_file $I $CARD_NAME
@@ -146,8 +146,8 @@ function run_test {
echo "Probing card in terminal #$I" echo "Probing card in terminal #$I"
CARD_NAME=$(probe_card $I) CARD_NAME=$(probe_card $I)
if [ -z "$CARD_NAME" ]; then if [ -z "$CARD_NAME" ]; then
echo "Error: Unresponsive card!" echo "Warning: Unresponsive card, trying next terminal..."
exit 1 continue
fi fi
echo "Card is of type: $CARD_NAME" echo "Card is of type: $CARD_NAME"
@@ -216,7 +216,8 @@ N_TERMINALS=$OPT_N_TERMINALS
# then the number of cards will be used as reader number. # then the number of cards will be used as reader number.
gen_card_list gen_card_list
if [ $N_TERMINALS -eq 0 ]; then if [ $N_TERMINALS -eq 0 ]; then
N_TERMINALS=$N_CARDS N_TERMINALS=`pcsc_scan -r | sed '$!d' | cut -d ':' -f 1`
((N_TERMINALS++))
fi fi
echo "Number of card terminals installed: $N_TERMINALS" echo "Number of card terminals installed: $N_TERMINALS"
echo "" echo ""