Skip to content

Commit 02ff284

Browse files
committed
implemented test that client with incorrect startup kit cannot connect
1 parent 095c1b7 commit 02ff284

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

runIntegrationTests.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,51 @@ kill_registry_docker () {
285285
}
286286

287287

288+
verify_wrong_client_does_not_connect () {
289+
echo "[Run] Verify that client with outdated startup kit does not connect ..."
290+
291+
cp -r "$PROJECT_DIR"/prod_01 "$PROJECT_DIR"/prod_wrong_client
292+
cd "$PROJECT_DIR"/prod_wrong_client
293+
cd localhost/startup
294+
./docker.sh --no_pull --start_server
295+
cd ../..
296+
sleep 10
297+
298+
rm client_A -rf
299+
tar xvf "$CWD"/tests/integration_tests/outdated_startup_kit.tar.gz
300+
sed -i 's#DOCKER_IMAGE=localhost:5000/odelia:1.0.1-dev.250919.095c1b7#DOCKER_IMAGE='$DOCKER_IMAGE'#' client_A/startup/docker.sh
301+
sed -i 's#CONTAINER_NAME=odelia_swarm_client_client_A_095c1b7#CONTAINER_NAME=odelia_swarm_client_client_A_'$CONTAINER_VERSION_SUFFIX'#' client_A/startup/docker.sh
302+
303+
cd client_A/startup
304+
./docker.sh --no_pull --data_dir "$SYNTHETIC_DATA_DIR" --scratch_dir "$SCRATCH_DIR"/client_A --GPU device=$GPU_FOR_TESTING --start_client
305+
cd ../..
306+
307+
sleep 20
308+
309+
CONSOLE_OUTPUT_SERVER=localhost/startup/nohup.out
310+
CONSOLE_OUTPUT_CLIENT=client_A/startup/nohup.out
311+
312+
if grep -q "Total clients: 1" $CONSOLE_OUTPUT_SERVER; then
313+
echo "Connection with non-authorized client"
314+
exit 1
315+
else
316+
echo "Connection rejected successfully by server"
317+
fi
318+
319+
if grep -q "SSLCertVerificationError" $CONSOLE_OUTPUT_CLIENT; then
320+
echo "Connection rejected successfully by client"
321+
else
322+
echo "Could not verify that connection was rejected"
323+
exit 1
324+
fi
325+
326+
docker kill odelia_swarm_server_flserver_$CONTAINER_VERSION_SUFFIX odelia_swarm_client_client_A_$CONTAINER_VERSION_SUFFIX
327+
rm -rf "$PROJECT_DIR"/prod_wrong_client
328+
329+
cd "$CWD"
330+
}
331+
332+
288333
run_dummy_training_in_swarm () {
289334
echo "[Run] Dummy training in swarm ..."
290335

@@ -433,6 +478,14 @@ case "$1" in
433478
# TODO add to CI if we want this (takes several minutes)
434479
;;
435480

481+
check_wrong_startup_kit)
482+
create_startup_kits_and_check_contained_files
483+
create_synthetic_data
484+
verify_wrong_client_does_not_connect
485+
cleanup_temporary_data
486+
# TODO add to CI if we want this
487+
;;
488+
436489
run_dummy_training_in_swarm)
437490
create_startup_kits_and_check_contained_files
438491
create_synthetic_data
@@ -459,6 +512,7 @@ case "$1" in
459512
run_docker_gpu_preflight_check
460513
run_data_access_preflight_check
461514
start_server_and_clients
515+
verify_wrong_client_does_not_connect
462516
run_dummy_training_in_swarm
463517
kill_server_and_clients
464518
cleanup_temporary_data

0 commit comments

Comments
 (0)