r69 - in regression_tests: bin tests tests/5001_scsim_verifypin tests/5001_scsim_verifypin/expected_output

erik at minisip.org erik at minisip.org
Thu Dec 21 12:05:17 CET 2006


Author: erik
Date: 2006-12-21 12:05:16 +0100 (Thu, 21 Dec 2006)
New Revision: 69

Added:
   regression_tests/tests/5001_scsim_verifypin/
   regression_tests/tests/5001_scsim_verifypin/Makefile
   regression_tests/tests/5001_scsim_verifypin/expected_output/
   regression_tests/tests/5001_scsim_verifypin/expected_output/expected_output
   regression_tests/tests/5001_scsim_verifypin/test.sh
   regression_tests/tests/5001_scsim_verifypin/tst.cxx
Modified:
   regression_tests/bin/regression_test.sh
Log:

 * Added a first test of the smart card interface (connect to card and
   enter pin).



Modified: regression_tests/bin/regression_test.sh
===================================================================
--- regression_tests/bin/regression_test.sh	2006-12-15 11:17:07 UTC (rev 68)
+++ regression_tests/bin/regression_test.sh	2006-12-21 11:05:16 UTC (rev 69)
@@ -28,7 +28,7 @@
     cd $LIB
     echo "" >&2
     echo "AUTOBUILD_INFO: processing ${LIB}..." >&2
-    ./bootstrap && ./configure --enable-dropemul prefix=$PREFIX && make -j2 && make install || { echo "ERROR: Could not bootstrap/configure/compile/install ${LIB}" >> $BASE/report.summary && exit 1 ; }
+    ./bootstrap && ./configure --enable-dropemul --enable-scsim prefix=$PREFIX && make -j2 && make install || { echo "ERROR: Could not bootstrap/configure/compile/install ${LIB}" >> $BASE/report.summary && exit 1 ; }
     cd .. 
 done
 

Added: regression_tests/tests/5001_scsim_verifypin/Makefile
===================================================================
--- regression_tests/tests/5001_scsim_verifypin/Makefile	2006-12-15 11:17:07 UTC (rev 68)
+++ regression_tests/tests/5001_scsim_verifypin/Makefile	2006-12-21 11:05:16 UTC (rev 69)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+	g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+	rm -f build_output diff_output test_output tst

Added: regression_tests/tests/5001_scsim_verifypin/expected_output/expected_output
===================================================================
--- regression_tests/tests/5001_scsim_verifypin/expected_output/expected_output	2006-12-15 11:17:07 UTC (rev 68)
+++ regression_tests/tests/5001_scsim_verifypin/expected_output/expected_output	2006-12-21 11:05:16 UTC (rev 69)
@@ -0,0 +1,3 @@
+creating SipSim...
+verifying pin...
+pin ok

Added: regression_tests/tests/5001_scsim_verifypin/test.sh
===================================================================
--- regression_tests/tests/5001_scsim_verifypin/test.sh	2006-12-15 11:17:07 UTC (rev 68)
+++ regression_tests/tests/5001_scsim_verifypin/test.sh	2006-12-21 11:05:16 UTC (rev 69)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1  || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+	diff -u expected_output/expected_output test_output > diff_output ;
+else 
+	echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+


Property changes on: regression_tests/tests/5001_scsim_verifypin/test.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: regression_tests/tests/5001_scsim_verifypin/tst.cxx
===================================================================
--- regression_tests/tests/5001_scsim_verifypin/tst.cxx	2006-12-15 11:17:07 UTC (rev 68)
+++ regression_tests/tests/5001_scsim_verifypin/tst.cxx	2006-12-21 11:05:16 UTC (rev 69)
@@ -0,0 +1,34 @@
+
+#include<libmcrypto/SipSimSmartCardGD.h>
+
+#include<iostream>
+#include<string>
+#include<list>
+
+using namespace std;
+
+//TODO: do not send pin as int
+
+int main(){
+
+	try{
+		cout << "creating SipSim..."<<endl;
+		MRef<SipSimSmartCardGD *> sim = new SipSimSmartCardGD;
+		cout << "verifying pin..."<<endl;
+		sim -> setPin(1000);
+		if (sim->verifyPin(0)){
+			cout << "pin ok"<<endl;
+		}else{
+			cout << "pin not ok"<<endl;
+		}
+
+	}catch(Exception &e){
+		cerr << "Caught exception: "<< flush << e.what()<<endl;
+	}
+
+	return 0;
+
+
+	return 0;
+}
+



More information about the Minisip-devel mailing list