TestSpecs/gen: take description into account; fine tune file printing
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 17 Aug 2010 16:00:29 +0000 (19:00 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 17 Aug 2010 16:00:29 +0000 (19:00 +0300)
TestSpecs/gen/tgen

index 6f409bb..2feeb73 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+#
+# Test scenario generators - generates *.cfg files
+#
 # 2010, Razvan Deaconescu, razvan.deaconescu@cs.pub.ro
 #
 # Sample run:
@@ -39,18 +42,19 @@ generate_scenario()
        down_bw=$5
        up_bw=$6
        seed_torrent=$7
+       description=$8
 
        echo -e "#\n# Campaign $campaign_name; scenario $exp_no\n#"
        echo "### BEGIN SCENARIO INFO"
        echo "# Id: $exp_no"
-       echo "# Description: TODO"
+       echo "# Description: $description"
        echo "# Number of seeders: $num_seeders"
        echo "# Number of leechers: $num_leechers"
-       echo "# Client type: TODO"
+       echo "# Client type: hrktorrent (libtorrent-rasterbar)"
        echo "### END SCENARIO INFO"
        echo ""
 
-       echo -e "# Hostname\t\t\tSSHport\t\tUser\t\tRemoteFolder\t\tNetInterface\t\tDownload(Mbps)\tDownloadBurst(K)\tUpload(Mbps)\tUploadBurst(K)\t\tPreRunScript\t\tPostRunScript\t\tClientType\t\tTorrentFile\t\tPeriods"
+       echo -e "# Hostname\t\t\tSSHport\t\tUser\t\tRemoteFolder\t\tNetInterface\t\tDownload(Mbps)\tDownloadBurst(K)\tUpload(Mbps)\tUploadBurst(K)\t\tPreRunScript\t\tPostRunScript\t\tClientType\t\t\tTorrentFile\t\tPeriods"
        index=0
        for sys_index in 01 03 04 05 06 07 08 09 10; do
                for ce_index in 1 2 3 4 5 6 7 8 9 10; do
@@ -58,7 +62,7 @@ generate_scenario()
                        echo -en "1$(printf %02g $ce_index)22\t\t"
                        echo -en "p2p\t\t"
                        echo -en "/home/p2p/george\t"
-                       echo -en "eth0\t\t"
+                       echo -en "eth0\t\t\t"
                        echo -en "$down_bw\t\t"
                        echo -en "100\t\t\t"
                        echo -en "$up_bw\t\t"
@@ -69,7 +73,7 @@ generate_scenario()
                        if test $index -lt $num_seeders; then
                                echo -en "hrktorrent_seeder_limit\t\t"
                        elif test $index -lt $(($num_seeders+$num_leechers)); then
-                               echo -en "hrktorrent_leecher_limit\t\t"
+                               echo -en "hrktorrent_leecher_limit\t"
                        fi
 
                        echo -en "$seed_torrent\t"
@@ -84,11 +88,11 @@ generate_scenario()
        done
 }
 
-while IFS="," read exp_no num_seeders num_leechers num_peers num_conn down_bw up_bw data_size; do
+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_scenario "$exp_no" "$num_seeders" "$num_leechers" "$this_conn" "$this_down_bw" "$this_up_bw" "$this_seed_torrent" > "${campaign_name}-${exp_no}".cfg
+       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
 done < $input