]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Add the beginning of transaction negotiation test
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 22 Jun 2010 14:53:27 +0000 (16:53 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 22 Jun 2010 14:53:27 +0000 (16:53 +0200)
frsh_api/tests/Makefile.omk
frsh_api/tests/trans_nego.c [new file with mode: 0644]
frsh_api/tests/trans_nego.sh [new file with mode: 0755]

index de636a81a66fbd0e9f05d0e69b4ad4bb07dbbacb..6eb7237e602c08134911a98a270a17c69dc523f0 100644 (file)
@@ -24,6 +24,11 @@ test_PROGRAMS += dummy_spare_capacity
 dummy_spare_capacity_SOURCES = dummy_spare_capacity.c
 dummy_spare_capacity_LIBS = wvtest
 
+wvtest_SCRIPTS += trans_nego.sh
+test_PROGRAMS += trans_nego
+trans_nego_SOURCES = trans_nego.c
+trans_nego_LIBS = wvtest
+
 test_PROGRAMS += negobench
 negobench_SOURCES = negobench.c
 
diff --git a/frsh_api/tests/trans_nego.c b/frsh_api/tests/trans_nego.c
new file mode 100644 (file)
index 0000000..df9a581
--- /dev/null
@@ -0,0 +1,12 @@
+#include <frsh.h>
+#include <wvtest.h>
+#include <res_dummy.h>
+
+WVTEST_MAIN("transaction negotiation")
+{
+       WVFRSH(frsh_init());
+       WVFRSH(fra_dummy_init_and_activate_id(0));
+       WVFRSH(fra_dummy_init_and_activate_id(1));
+       
+       frsh_destroy();
+}
diff --git a/frsh_api/tests/trans_nego.sh b/frsh_api/tests/trans_nego.sh
new file mode 100755 (executable)
index 0000000..42d7741
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+. $(dirname $0)/wvtest.sh
+
+WVSTART Setup
+WVPASS fcb -dfcb.pid
+WVPASS frm_dummy -dfrm.pid
+WVPASS frm_dummy -dfrm0.pid -i0
+WVPASS frm_dummy -dfrm1.pid -i1
+
+trap '
+WVSTART Kill
+WVPASS kill `cat fcb.pid`
+WVPASS rm fcb.pid
+WVPASS kill `cat frm.pid`
+WVPASS rm frm.pid
+WVPASS kill `cat frm0.pid`
+WVPASS rm frm0.pid
+WVPASS kill `cat frm1.pid`
+WVPASS rm frm1.pid
+' 0
+
+WVPASS trans_nego