Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys
  3. import os
  4. import xml.etree.ElementTree as ET
  5. from time import sleep
  6.  
  7. site = sys.argv[1]
  8. delay = str(int(sys.argv[2])*2)
  9. link_speed = str(sys.argv[3])
  10. operation = "./wpt_batch.py -s http://172.16.65.143/ -i " + site + " -o \"Test_WPT\" -r 1 -a VIDEO -u " + link_speed + " -d " + link_speed + " -l " + delay
  11. print operation
  12. os.system(operation)
  13.  
  14. tree = ET.parse("result/" + site + "." + delay + "-" + link_speed + ".xml")
  15. speedIndex = tree.find(".//SpeedIndex").text if tree.find(".//SpeedIndex") != None else ""
  16. output = site + "\t\tDelay: " + delay + "\tBW: " + link_speed + "\tSpeedIndex: " + speedIndex + "\n"
  17.  
  18. print output
  19. with open(delay+ "_" + link_speed + "_results.txt", "a") as f:
  20. f.write(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement