Skip to content

Commit 30505e8

Browse files
committed
Added sample workload script to be used on treecript demos.
The script has as workload the fetch of a couple of archives available in a site (two archives of linux kernel sources), one of them packed with tar + gz and the other with tar + xz , interleaved all the tasks with `sleep 2` calls in order to offer a clear separation between the tasks.
1 parent 3acbc61 commit 30505e8

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
workdir="$(mktemp -d --tmpdir treecript_demo.XXXXXXXXXX)"
4+
5+
cleanup() {
6+
set +e
7+
# This is needed in order to avoid
8+
# potential "permission denied" messages
9+
chmod -R u+w "${workdir}"
10+
rm -rf "${workdir}"
11+
}
12+
13+
trap cleanup EXIT
14+
15+
file1=https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.6.114.tar.gz
16+
file2=https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.6.114.tar.xz
17+
18+
echo Fetching first file "${file1}"
19+
wget -nv -P "${workdir}" "${file1}"
20+
echo Sleeping 2 seconds
21+
sleep 2
22+
echo Fetching second file "${file2}"
23+
wget -nv -P "${workdir}" "${file2}"
24+
echo Sleeping 2 more seconds
25+
sleep 2
26+
echo Testing integrity of first file
27+
gunzip -t "${workdir}"/*.gz
28+
tar tf "${workdir}"/*.gz
29+
echo Sleeping the last 2 seconds
30+
sleep 2
31+
echo Testing integrity of second file
32+
xz -T -t "${workdir}"/*.xz
33+
tar tf "${workdir}"/*.xz

0 commit comments

Comments
 (0)