Skip to content

Commit 9408a54

Browse files
committed
Consolidate test script
1 parent f0e804a commit 9408a54

File tree

6 files changed

+58
-82
lines changed

6 files changed

+58
-82
lines changed

tests/integration/bash_tests/run_from_chrysalis/blocking_test_scripts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ to running Globus transfers.
7373
It is suggested that you run the test script with
7474

7575
```
76-
test_zstash_blocking.sh (BLOCKING|NON_BLOCKING) 2>&1 | tee your_logfile
76+
./test_zstash_blocking.sh (BLOCKING|NON_BLOCKING) 2>&1 | tee your_logfile
7777
```
7878

7979
so that your command prompt returns and you can monitor progress with `snapshot.sh`, which will provide a view of both the tarfile cache and the destination
8080
directory for delivered tar files. It is also suggested that you name your
8181
logfile to reflect the date, and whether BLOCKING or not was specified. Example:
8282
```bash
83-
test_zstash_blocking.sh BLOCKING 2>&1 | tee test_zstash_blocking_20251020.log
83+
./test_zstash_blocking.sh BLOCKING 2>&1 | tee test_zstash_blocking_20251020.log
8484
```
8585

8686
FINAL NOTE: In the zstash code, the tar file `MINSIZE` parameter is taken

tests/integration/bash_tests/run_from_chrysalis/blocking_test_scripts/gen_data.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/integration/bash_tests/run_from_chrysalis/blocking_test_scripts/gen_data_runner.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/integration/bash_tests/run_from_chrysalis/blocking_test_scripts/reset_test.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/integration/bash_tests/run_from_chrysalis/blocking_test_scripts/snapshot.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,74 @@
11
#!/bin/bash
22

3-
if [[ $# -lt 1 ]]; then
4-
echo "Usage: text_zstash_blocking.sh (BLOCKING|NON_BLOCKING)"
5-
echo " One of \"BLOCKING\" or \"NON_BLOCKING\" must be supplied as the"
6-
echo " first parameter."
7-
exit 0
8-
fi
9-
10-
NON_BLOCKING=1
11-
12-
if [[ $1 == "BLOCKING" ]]; then
13-
NON_BLOCKING=0
14-
elif [[ $1 == "NON_BLOCKING" ]]; then
15-
NON_BLOCKING=1
16-
else
17-
echo "ERROR: Must supply \"BLOCKING\" or \"NON_BLOCKING\" as 1st argument."
18-
exit 0
19-
fi
20-
21-
22-
base_dir=`pwd`
23-
base_dir=`realpath $base_dir`
24-
25-
26-
# See if we are running the zstash we THINK we are:
27-
echo "CALLING zstash version"
28-
zstash version
29-
echo ""
3+
# Set up Globus Endpoint UUIDs ################################################
304

315
# Selectable Endpoint UUIDs
326
ACME1_GCSv5_UUID=6edb802e-2083-47f7-8f1c-20950841e46a
337
LCRC_IMPROV_DTN_UUID=15288284-7006-4041-ba1a-6b52501e49f1
348
NERSC_HPSS_UUID=9cd89cfd-6d04-11e5-ba46-22000b92c6ec
359

36-
# 12 piControl ocean monthly files, 49 GB
37-
SRC_DATA=$base_dir/src_data
38-
DST_DATA=$base_dir/dst_data
39-
4010
SRC_UUID=$LCRC_IMPROV_DTN_UUID
4111
DST_UUID=$LCRC_IMPROV_DTN_UUID
4212

43-
# Optional
44-
TMP_CACHE=$base_dir/tmp_cache
45-
46-
mkdir -p $SRC_DATA $DST_DATA $TMP_CACHE
13+
# Helper functions ############################################################
14+
make_test_dirs() {
15+
# base_dir=`pwd`
16+
# base_dir=`realpath $base_dir`
17+
base_dir="/home/ac.forsyth2/ez/zstash/tests/utils/test_blocking/"
18+
19+
# 12 piControl ocean monthly files, 49 GB
20+
SRC_DATA=$base_dir/src_data
21+
DST_DATA=$base_dir/dst_data
22+
23+
mkdir -p $SRC_DATA $DST_DATA
24+
}
25+
26+
generate_test_data() {
27+
i=1
28+
len=1000000 # in bytes
29+
while [[ $i -lt 12 ]]; do
30+
out=small_0${i}_1M
31+
head -c $len </dev/urandom >$out
32+
i=$((i+1))
33+
done
34+
}
35+
36+
snapshot() {
37+
echo "dst_data:"
38+
ls -l $DST_DATA
39+
40+
echo ""
41+
echo "src_data/zstash:"
42+
ls -l $SRC_DATA/zstash
43+
}
44+
45+
remove_test_dirs() {
46+
rm -rf "$SRC_DATA/zstash/"
47+
rm -f "$DST_DATA"/*
48+
}
49+
50+
# Run tests ###################################################################
4751

4852
# Make maxsize 1 GB. This will create a new tar after every 1 GB of data.
4953
# (Since individual files are 4 GB, we will get 1 tarfile per datafile.)
54+
MAXSIZE=1 # GB
5055

51-
if [[ $NON_BLOCKING -eq 1 ]]; then
52-
echo "TEST: NON_BLOCKING:"
53-
zstash create -v --hpss=globus://$DST_UUID/$DST_DATA --maxsize 1 --non-blocking $SRC_DATA
54-
else
55-
echo "TEST: BLOCKING:"
56-
zstash create -v --hpss=globus://$DST_UUID/$DST_DATA --maxsize 1 $SRC_DATA
57-
# zstash create -v --hpss=globus://$DST_UUID --maxsize 1 --non-blocking --cache $TMP_CACHE $SRC_DATA
58-
fi
56+
remove_test_dirs # Start fresh
5957

60-
echo "Testing Completed"
58+
echo "TEST: NON_BLOCKING"
59+
make_test_dirs
60+
generate_test_data
61+
time zstash create -v --hpss=globus://$DST_UUID/$DST_DATA --maxsize ${MAXSIZE} --non-blocking $SRC_DATA
62+
snapshot
63+
remove_test_dirs
6164

65+
echo "TEST: BLOCKING"
66+
make_test_dirs
67+
generate_test_data
68+
time zstash create -v --hpss=globus://$DST_UUID/$DST_DATA --maxsize ${MAXSIZE} $SRC_DATA
69+
snapshot
70+
remove_test_dirs
71+
72+
echo "Testing Completed"
73+
echo "Go to https://app.globus.org/activity to confirm Globus transfers completed successfully."
6274
exit 0

0 commit comments

Comments
 (0)