TestSpecs/gen: fill campaign configuration file and HTML output file
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 17 Aug 2010 17:43:22 +0000 (20:43 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 17 Aug 2010 17:43:22 +0000 (20:43 +0300)
TestSpecs/gen/tgen

index 2feeb73..0997db5 100755 (executable)
@@ -88,11 +88,58 @@ generate_scenario()
        done
 }
 
+campaign_file=${campaign_name}.cfg
+
+> "${campaign_file}" cat <<END
+#
+# ${campaign_name}
+#
+# Scenario description         R script for plotting
+END
+
+html_file=${campaign_name}.html
+cat start.html > ${html_file}
+cat >> ${html_file} <<END
+        <table id="box-table-a" summary="${campaign_name} results">
+          <thead>
+            <tr>
+              <th scope="col">Name</th>
+              <th scope="col">No. of Seeders</th>
+              <th scope="col">No. of Leechers</th>
+              <th scope="col">Bandwidth Rectrictions</th>
+              <th scope="col">Graphs</th>
+            </tr>
+          </thead>
+          <tbody>
+END
+
 while IFS="," read exp_no num_seeders num_leechers num_peers num_conn down_bw up_bw data_size description; do
        this_conn=$(parse_conn $num_conn)
        this_down_bw=$(parse_bw $down_bw)
        this_up_bw=$(parse_bw $up_bw)
        this_seed_torrent=$(parse_file $data_size)
 
+       # generate test scenario
        generate_scenario "$exp_no" "$num_seeders" "$num_leechers" "$this_conn" "$this_down_bw" "$this_up_bw" "$this_seed_torrent" "$description" > "${campaign_name}-${exp_no}".cfg
+
+       # update campaign configuration file
+       echo -e "${campaign_name}-${exp_no}.cfg\t${campaign_name}-${exp_no}.R" >> "${campaign_file}"
+
+       # update campaign HTML file
+       cat >> ${html_file} <<END
+            <tr>
+              <td>${campaign_name}-${exp_no}</td>
+              <td>${num_seeders}</td>
+              <td>${num_leechers}</td>
+              <td>TODO</td>
+              <td><a href="${campaign_name}/${campaign_name}-${exp_no}.png">dlspeed vs percent</a>; <a href="${campaign_name}/${campaign_name}-${exp_no}.png">dlspeed vs time</a></td>
+            </tr>
+END
 done < $input
+
+cat >> ${html_file} <<END
+          </tbody>
+        </table>
+END
+
+cat end.html >> ${html_file}