pySim-prog, pySim-read, do not echo reader id

pySim-prog and pySim-read currently echo back the pcsc reader id (or
baudrate/socket, depending on the interface used). This makes the output
unecessarly undeterministic, which becomes a problem when verifying the
putput in tests. Lets not echo those variable, user supplied parameters
back. Also lets move the code that does the initalization to utils, so
that it can be used from pySim-prog and from pySim-read (code dup).

Change-Id: I243cc332f075d007b1c111292effcc610e874eb3
Related: OS#4503
diff --git a/tests/pysim-test.sh b/tests/pysim-test.sh
index a22c372..7ee9834 100755
--- a/tests/pysim-test.sh
+++ b/tests/pysim-test.sh
@@ -78,13 +78,7 @@
     stat ./$CARD_NAME.ok > /dev/null
     python $PYSIM_READ -p $TERMINAL > $TEMPFILE
     set +e
-    # Note: We ignore the first line of output in the diff because here
-    # pysim would print the device number of the reader and we do not
-    # want the test to fail just because the card is put into a different
-    # reader device.
-    tail -n +2 $CARD_NAME.ok > $CARD_NAME.ok.tmp
-    tail -n +2 $TEMPFILE > $CARD_NAME.chk.tmp
-    CARD_DIFF=$(diff $CARD_NAME.chk.tmp $CARD_NAME.ok.tmp)
+    CARD_DIFF=$(diff $TEMPFILE ./$CARD_NAME.ok)
     set -e
 
     if [ "$CARD_DIFF" != "" ]; then
@@ -104,7 +98,7 @@
     inc_card_list $CARD_NAME
 
     echo "Card contents match the test data -- success!"
-    rm *.tmp
+    rm $TEMPFILE
 }
 
 # Read out the card using pysim-read and store the result as .ok file. This