Merge pull request #4 from illinois-cs-coursework/aryan
Removing custom proxy headers from tests
This commit is contained in:
4 files changed
+9
-10
No files matched your search
@@ -3,7 +3,7 @@
|
||||
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/kill_mp.sh all
|
||||
|
||||
for i in {1..10}; do
|
||||
vpn ssh -n -f -o BatchMode=yes "server$i" "cd fa26_cs425_.group-mp_.team-01/MP1 && git pull origin aryan && ~/fa26_cs425_.group-mp_.team-01/MP1/scripts/install_cmd.sh"
|
||||
ssh -n -f -o BatchMode=yes "server$i" "cd fa26_cs425_.group-mp_.team-01/MP1 && git pull origin aryan && ~/fa26_cs425_.group-mp_.team-01/MP1/scripts/install_cmd.sh"
|
||||
done
|
||||
|
||||
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/run_mp.sh all
|
||||
@@ -3,13 +3,13 @@
|
||||
if [[ "$1" == "all" ]]; then
|
||||
for i in {1..10}; do
|
||||
echo "Killing server$i..."
|
||||
vpn ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
echo ""
|
||||
done
|
||||
else
|
||||
for i in "$@"; do
|
||||
echo "Killing server$i..."
|
||||
vpn ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
echo ""
|
||||
done
|
||||
fi
|
||||
@@ -16,13 +16,13 @@ fi
|
||||
echo "Starting servers"
|
||||
|
||||
for i in $TARGETS; do
|
||||
vpn ssh -n -f -o BatchMode=yes "server$i" "$CMD"
|
||||
ssh -n -f -o BatchMode=yes "server$i" "$CMD"
|
||||
done
|
||||
|
||||
sleep 2
|
||||
|
||||
for i in $TARGETS; do
|
||||
pid=$(vpn ssh -n -o BatchMode=yes "server$i" "pgrep -o -u \$USER -f '[p]ython3 server.py'")
|
||||
pid=$(ssh -n -o BatchMode=yes "server$i" "pgrep -o -u \$USER -f '[p]ython3 server.py'")
|
||||
|
||||
if [[ -n "$pid" ]]; then
|
||||
pid_clean=$(echo "$pid" | tr '\n' ' ')
|
||||
|
||||
+4
-5
@@ -290,20 +290,19 @@ Total matches: 100
|
||||
#generate log files on all the machines before running this test
|
||||
print("Generating log files on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
subprocess.run(["vpn", "ssh", f"asing271@{ip}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && python3 generate_log.py {i + 1} 100"])
|
||||
subprocess.run(["ssh", f"asing271@{ip}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && python3 generate_log.py {i + 1} 100"])
|
||||
|
||||
#start the server on all the machines before running this test
|
||||
print("Starting server on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
print(f"Starting server on machine {i + 1} ({ip})...")
|
||||
subprocess.run([
|
||||
"vpn", "ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && setsid -f python3 server.py > server.log 2>&1 < /dev/null"])
|
||||
subprocess.run(["ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && setsid -f python3 server.py > server.log 2>&1 < /dev/null"])
|
||||
|
||||
#ssh into one machine at randome
|
||||
machine_num = random.randint(1, len(ALL_IPS))
|
||||
print(f"Running grep command on a {machine_num} random machine...")
|
||||
for i in tests:
|
||||
result = subprocess.run(["vpn", "ssh", f"asing271@{ALL_IPS[machine_num - 1]}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && grepp {i} -t"], capture_output=True, text=True)
|
||||
result = subprocess.run(["ssh", f"asing271@{ALL_IPS[machine_num - 1]}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && grepp {i} -t"], capture_output=True, text=True)
|
||||
if result.stdout.strip() == results[tests.index(i)].strip():
|
||||
print("PASS {i} test")
|
||||
else:
|
||||
@@ -312,4 +311,4 @@ for i in tests:
|
||||
#delete log files on all the machines after running this test
|
||||
print("Deleting log files on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
subprocess.run(["vpn", "ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
||||
subprocess.run(["ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
||||
Reference in new issue
Block a user