Configured for jouya
This commit is contained in:
1 parent
015a142735
commit
8a87db81c1
5 files changed
+18
-18
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
#/usr/bin/env bash
|
#/usr/bin/env bash
|
||||||
|
|
||||||
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/kill_mp.sh all
|
~/fa26_cs425_.group-mp_.team-01/MP1/scripts/kill_mp.sh all
|
||||||
|
|
||||||
for i in {1..10}; do
|
for i in {1..10}; do
|
||||||
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 "vm$i" "cd fa26_cs425_.group-mp_.team-01/MP1 && git switch justin && git pull origin justin && ~/fa26_cs425_.group-mp_.team-01/MP1/scripts/install_cmd.sh"
|
||||||
done
|
done
|
||||||
|
|
||||||
/Users/aryan/Documents/Github/fa26_cs425_.group-mp_.team-01/MP1/scripts/run_mp.sh all
|
~/fa26_cs425_.group-mp_.team-01/MP1/scripts/run_mp.sh all
|
||||||
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
if [[ "$1" == "all" ]]; then
|
if [[ "$1" == "all" ]]; then
|
||||||
for i in {1..10}; do
|
for i in {1..10}; do
|
||||||
echo "Killing server$i..."
|
echo "Killing vm$i..."
|
||||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
ssh -o BatchMode=yes "vm$i" "fuser -k -9 5055/tcp"
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
echo "Killing server$i..."
|
echo "Killing vm$i..."
|
||||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
ssh -o BatchMode=yes "vm$i" "fuser -k -9 5055/tcp"
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -16,18 +16,18 @@ fi
|
|||||||
echo "Starting servers"
|
echo "Starting servers"
|
||||||
|
|
||||||
for i in $TARGETS; do
|
for i in $TARGETS; do
|
||||||
ssh -n -f -o BatchMode=yes "server$i" "$CMD"
|
ssh -n -f -o BatchMode=yes "vm$i" "$CMD"
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
for i in $TARGETS; do
|
for i in $TARGETS; do
|
||||||
pid=$(ssh -n -o BatchMode=yes "server$i" "pgrep -o -u \$USER -f '[p]ython3 server.py'")
|
pid=$(ssh -n -o BatchMode=yes "vm$i" "pgrep -o -u \$USER -f '[p]ython3 server.py'")
|
||||||
|
|
||||||
if [[ -n "$pid" ]]; then
|
if [[ -n "$pid" ]]; then
|
||||||
pid_clean=$(echo "$pid" | tr '\n' ' ')
|
pid_clean=$(echo "$pid" | tr '\n' ' ')
|
||||||
echo "Server$i is running with PID(s): $pid_clean"
|
echo "vm$i is running with PID(s): $pid_clean"
|
||||||
else
|
else
|
||||||
echo "Server$i is not running."
|
echo "vm$i is not running."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import subprocess
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
HOST = "0.0.0.0"
|
HOST = "0.0.0.0"
|
||||||
PORT = 5055
|
PORT = 5054
|
||||||
|
|
||||||
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -290,25 +290,25 @@ Total matches: 100
|
|||||||
#generate log files on all the machines before running this test
|
#generate log files on all the machines before running this test
|
||||||
print("Generating log files on all machines...")
|
print("Generating log files on all machines...")
|
||||||
for i, ip in enumerate(ALL_IPS):
|
for i, ip in enumerate(ALL_IPS):
|
||||||
subprocess.run(["ssh", f"asing271@{ip}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && python3 generate_log.py {i + 1} 100"])
|
subprocess.run(["ssh", f"vm{i + 1}", 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
|
#start the server on all the machines before running this test
|
||||||
print("Starting server on all machines...")
|
print("Starting server on all machines...")
|
||||||
for i, ip in enumerate(ALL_IPS):
|
for i, ip in enumerate(ALL_IPS):
|
||||||
print(f"Starting server on machine {i + 1} ({ip})...")
|
print(f"Starting server on machine {i + 1} ({ip})...")
|
||||||
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"])
|
subprocess.run(["ssh", f"vm{i + 1}", "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
|
#ssh into one machine at randome
|
||||||
machine_num = random.randint(1, len(ALL_IPS))
|
machine_num = random.randint(1, len(ALL_IPS))
|
||||||
print(f"Running grep command on a {machine_num} random machine...")
|
print(f"Running grep command on a {machine_num} random machine...")
|
||||||
for i in tests:
|
for i in tests:
|
||||||
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)
|
result = subprocess.run(["ssh", f"vm{machine_num}", 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():
|
if result.stdout.strip() == results[tests.index(i)].strip():
|
||||||
print("PASS {i} test")
|
print(f"PASS {i} test")
|
||||||
else:
|
else:
|
||||||
print("FAIL {i} test")
|
print(f"FAIL {i} test")
|
||||||
|
|
||||||
#delete log files on all the machines after running this test
|
#delete log files on all the machines after running this test
|
||||||
print("Deleting log files on all machines...")
|
print("Deleting log files on all machines...")
|
||||||
for i, ip in enumerate(ALL_IPS):
|
for i, ip in enumerate(ALL_IPS):
|
||||||
subprocess.run(["ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
subprocess.run(["ssh", f"vm{i + 1}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
||||||
Reference in new issue
Block a user