]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
test: Split test to subtests
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 19 Jun 2010 07:30:35 +0000 (09:30 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 19 Jun 2010 07:30:35 +0000 (09:30 +0200)
build/aquosa/tests/negotiation.cc
build/aquosa/tests/t0001-negotiation.sh

index f4cc5bfdba42dfd3bcfc0d0eb8dd49ef49f1427c..d4ce749cbcd6ed3448481787a7829401e7509029 100644 (file)
@@ -23,14 +23,14 @@ int b[N] = { 10, 20, 30 };
 //     printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
 // }
 
+int ret;
+frsh_contract_t contract[N];
+frsh_vres_id_t vres[N];
+frsh_rel_time_t budget, period, deadline;
+int i;
 
 WVTEST_MAIN("basic negotiation")
 {
-       int ret;
-       frsh_contract_t contract[N];
-       frsh_vres_id_t vres[N];
-       frsh_rel_time_t budget, period, deadline;
-       int i;
 //     char opt;
 
 //     while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) {
@@ -76,6 +76,10 @@ WVTEST_MAIN("basic negotiation")
                ret = WVFRSH(frsh_contract_negotiate(&contract[i], &vres[i]));
                if (ret) exit(1);
        }
+}
+
+WVTEST_MAIN("renegotiation")
+{
        for (i=0; i<2 /*N*/; i++) {
                // FIXME: There is a bug on the test - the 3rd renegotiation fails
                budget = fosa_msec_to_rel_time(2*b[i]);
@@ -90,7 +94,10 @@ WVTEST_MAIN("basic negotiation")
                ret = WVFRSH(frsh_contract_renegotiate_sync(&contract[i], vres[i]));
                if (ret) exit(1);
        }
+}
 
+WVTEST_MAIN("cancelation")
+{
        /* Cancel N contracts */
        for (i=0; i<N; i++) {
                ret = WVFRSH(frsh_contract_cancel(vres[i]));
index 3e5cfdcddd0cf5aeab319b0962882ca7f9eb7351..1a6ede10220730f653127fe26e30f6b26aa4e862 100755 (executable)
@@ -6,6 +6,9 @@ WVSTART Setup
 WVPASS fcb -dfcb.pid
 WVPASS frm_dummy -dfrm.pid
 WVPASS negotiation.wv
+WVSTART Kill
 WVPASS kill `cat fcb.pid`
+WVPASS rm fcb.pid
 WVPASS kill `cat frm.pid`
+WVPASS rm frm.pid