change to 5056
This commit is contained in:
1 parent
81528e1aff
commit
914ce22e5a
4 files changed
+10
-6
No files matched your search
+5
-1
@@ -2,7 +2,7 @@
|
||||
import socket
|
||||
import sys
|
||||
|
||||
PORT = 5055
|
||||
PORT = 5056
|
||||
ALL_IPS = [
|
||||
"172.22.156.3",
|
||||
"172.22.158.2",
|
||||
@@ -74,7 +74,10 @@ def grep_all_ips(ips, cmd, if_unit_test):
|
||||
#main
|
||||
#if unit test flag exists, then use the test log files instead of the actual log files
|
||||
cmd = "grep " + " ".join([arg for arg in sys.argv[1:] if arg != "-t"])
|
||||
#track time
|
||||
start_time = time.perf_counter()
|
||||
match_count = grep_all_ips(ALL_IPS, cmd, if_unit_test=[x for x in sys.argv].count("-t") > 0)
|
||||
end_time = time.perf_counter()
|
||||
|
||||
print("=========================== SUMMARY ===========================")
|
||||
for i, count in enumerate(match_count):
|
||||
@@ -90,3 +93,4 @@ for i, count in enumerate(match_count):
|
||||
print(f"machine.{i + 1}.log: {count} matches")
|
||||
print(f"Total matches: {max(0, sum(match_count))}")
|
||||
print("===============================================================")
|
||||
print(f"Time taken: {end_time - start_time:.2f} seconds")
|
||||
@@ -3,13 +3,13 @@
|
||||
if [[ "$1" == "all" ]]; then
|
||||
for i in {1..10}; do
|
||||
echo "Killing server$i..."
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5056/tcp"
|
||||
echo ""
|
||||
done
|
||||
else
|
||||
for i in "$@"; do
|
||||
echo "Killing server$i..."
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5055/tcp"
|
||||
ssh -o BatchMode=yes "server$i" "fuser -k -9 5056/tcp"
|
||||
echo ""
|
||||
done
|
||||
fi
|
||||
+1
-1
@@ -5,7 +5,7 @@ import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
HOST = "0.0.0.0"
|
||||
PORT = 5055
|
||||
PORT = 5056
|
||||
|
||||
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
|
||||
+2
-2
@@ -304,9 +304,9 @@ print(f"Running grep command on a {machine_num} random machine...")
|
||||
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)
|
||||
if result.stdout.strip() == results[tests.index(i)].strip():
|
||||
print("PASS {i} test")
|
||||
print(f"PASS {i} test")
|
||||
else:
|
||||
print("FAIL {i} test")
|
||||
print(f"FAIL {i} test")
|
||||
|
||||
#delete log files on all the machines after running this test
|
||||
print("Deleting log files on all machines...")
|
||||
|
||||
Reference in new issue
Block a user