Commit e672bca3 authored by StevenWdV's avatar StevenWdV

Test framework: added file generation, removed .txt

parent 5e7c6074
......@@ -4,6 +4,7 @@ import sys
import threading
import unittest
import os
import random
timeout = 100
winsize = 100
......@@ -12,8 +13,8 @@ netem_add = "sudo tc qdisc add dev {} root netem".format(intf)
netem_change = "sudo tc qdisc change dev {} root netem {}".format(intf, "{}")
netem_del = "sudo tc qdisc del dev {} root netem".format(intf)
infile = "in.txt"
outfile = "out.txt"
infile = "infile"
outfile = "outfile"
server_thread: threading.Thread
......@@ -166,6 +167,16 @@ if __name__ == "__main__":
timeout = args.timeout
winsize = args.window
if not os.path.isfile(infile):
file = open(infile, "w+b")
data = []
bytes_left = 5_000_000
while bytes_left > 0:
data.append(random.getrandbits(8))
bytes_left -= 1
file.write(bytes(data))
file.close()
run_client = f"./bTCP_client.py -t {timeout} -w {winsize} -i {infile}"
run_server = f"./bTCP_server.py -t {timeout} -w {winsize} -o {outfile}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment