2024-01-24 01:02:07 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2024 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-04-22 16:20:41 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
### Full test set (except mem)
|
2021-07-22 20:31:06 +00:00
|
|
|
testsuite: short
|
|
|
|
true
|
|
|
|
|
|
|
|
all: mem short long polar
|
2013-12-21 00:49:17 +00:00
|
|
|
true
|
2012-05-05 22:20:10 +00:00
|
|
|
|
2013-01-21 22:07:32 +00:00
|
|
|
3: ../src/parallel tests-to-run/* wanted-results/* startdb prereqlocal prereqremote
|
2016-05-08 12:18:10 +00:00
|
|
|
TRIES=3 time bash Start.sh '' mem || true
|
2014-07-14 16:25:45 +00:00
|
|
|
touch ~/.parallel/will-cite
|
2013-06-15 14:12:02 +00:00
|
|
|
make stopvm
|
2013-01-21 22:07:32 +00:00
|
|
|
|
2013-12-21 00:49:17 +00:00
|
|
|
1: ../src/parallel tests-to-run/* wanted-results/* prereqlocal startdb prereqremote
|
2020-12-30 12:42:02 +00:00
|
|
|
TRIES=1 time bash Start.sh '' mem || true
|
2015-03-17 19:44:09 +00:00
|
|
|
touch ~/.parallel/will-cite
|
|
|
|
make stopvm
|
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
# Mem
|
2020-10-22 19:47:01 +00:00
|
|
|
mem: ../src/parallel tests-to-run/*mem* wanted-results/*mem*
|
|
|
|
make stopvm || true
|
2015-04-09 23:20:51 +00:00
|
|
|
time bash Start.sh mem NONE || true
|
2014-07-14 16:25:45 +00:00
|
|
|
touch ~/.parallel/will-cite
|
2013-12-21 00:49:17 +00:00
|
|
|
make stopvm
|
|
|
|
|
2022-12-20 23:57:10 +00:00
|
|
|
# The output must be inspected visually
|
|
|
|
manual: ../src/parallel tests-to-run/*manual* wanted-results/*manual*
|
|
|
|
bash tests-to-run/parallel-manual.sh
|
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
# Tutorial
|
|
|
|
tutorial: ../src/parallel tests-to-run/*tutorial* wanted-results/*tutorial* prereqlocal
|
|
|
|
TRIES=1 time bash Start.sh tutorial NONE || true
|
|
|
|
touch ~/.parallel/will-cite
|
|
|
|
make stopvm
|
|
|
|
|
2020-09-23 15:41:03 +00:00
|
|
|
# 100s and 300s
|
|
|
|
100s: ../src/parallel tests-to-run/*00s* wanted-results/*00s* prereqlocal
|
|
|
|
time bash Start.sh 00s NONE || true
|
2019-07-23 07:00:09 +00:00
|
|
|
touch ~/.parallel/will-cite
|
|
|
|
make stopvm
|
|
|
|
|
|
|
|
# Polarhome
|
2017-01-21 17:09:01 +00:00
|
|
|
polarhome: polar
|
|
|
|
true
|
|
|
|
|
2016-04-05 22:57:07 +00:00
|
|
|
polar: ../src/parallel tests-to-run/*polar* wanted-results/*polar* prereqlocal
|
|
|
|
time bash Start.sh polar NONE || true
|
|
|
|
touch ~/.parallel/will-cite
|
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
# *local* only
|
2021-04-22 16:20:41 +00:00
|
|
|
local: ../src/parallel tests-to-run/*local* wanted-results/*local* prereqlocal installparallel
|
2015-07-22 06:28:05 +00:00
|
|
|
time bash Start.sh local mem
|
2012-05-05 22:20:10 +00:00
|
|
|
|
2021-04-22 16:20:41 +00:00
|
|
|
# short
|
|
|
|
short: ../src/parallel tests-to-run/* wanted-results/* prereqlocal installparallel
|
2022-12-20 23:57:10 +00:00
|
|
|
TRIES=1 time bash Start.sh '' 'polar|mem|100s|300s|manual'
|
2018-07-22 06:58:32 +00:00
|
|
|
|
2021-07-22 20:31:06 +00:00
|
|
|
# long
|
|
|
|
long: ../src/parallel tests-to-run/* wanted-results/* prereqlocal installparallel
|
|
|
|
TRIES=1 time bash Start.sh '00s' NONE
|
|
|
|
|
2021-04-22 16:20:41 +00:00
|
|
|
# short and local
|
|
|
|
localshort: ../src/parallel tests-to-run/*local* wanted-results/*local* prereqlocal installparallel
|
2020-01-22 17:03:29 +00:00
|
|
|
TRIES=1 time bash Start.sh local 'mem|100s|300s'
|
2018-07-22 06:58:32 +00:00
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
# sql
|
|
|
|
testdb: ../src/parallel tests-to-run/*sql* wanted-results/*sql* prereqdb
|
|
|
|
time bash Start.sh sql NONE
|
|
|
|
|
2020-12-12 17:12:04 +00:00
|
|
|
# Portable tests that run everywhere
|
2019-07-23 07:00:09 +00:00
|
|
|
portable:
|
|
|
|
# Cache sudo password
|
|
|
|
sudo echo
|
|
|
|
time bash Portable.sh
|
|
|
|
|
|
|
|
### Prerequisites
|
2020-10-22 19:47:01 +00:00
|
|
|
REQUIRE=bash -c '\
|
|
|
|
is_installed() { \
|
|
|
|
eval $$2 >/dev/null 2>/dev/null || (echo "$$1" is required for testsuite; /bin/false); \
|
|
|
|
}; \
|
|
|
|
export -f is_installed; \
|
|
|
|
parallel -n2 --tag is_installed ::: \
|
2022-10-15 19:09:51 +00:00
|
|
|
script "echo | script -c echo -q /dev/null" \
|
2020-10-22 19:47:01 +00:00
|
|
|
"ssh sh@lo" "timeout 20 ssh sh@lo true" \
|
|
|
|
"ssh csh@lo" "timeout 5 ssh csh@lo true" \
|
|
|
|
niceload "niceload echo niceload is installed" \
|
|
|
|
expect "expect -c \"spawn cat; puts \\\"expect is installed\\\"\"" \
|
2022-10-15 19:09:51 +00:00
|
|
|
autossh "autossh -V" \
|
|
|
|
tcsh "tcsh -c echo tcsh installed" \
|
|
|
|
seq "seq 1 2" \
|
|
|
|
stdout "stdout echo stdout is installed" \
|
|
|
|
convert "convert -version" \
|
|
|
|
bc "echo 1+2 | bc" \
|
|
|
|
gawk "echo | gawk \"{print \\\"gawk is installed\\\"}\"" \
|
|
|
|
pv "echo | pv -qL 10" \
|
|
|
|
timeout "timeout 1 echo timeout is installed" \
|
|
|
|
sshpass "sshpass echo sshpass is installed" \
|
2020-10-22 19:47:01 +00:00
|
|
|
'
|
2021-04-22 16:20:41 +00:00
|
|
|
# lsh "lsh lo echo lsh is installed" \
|
2020-10-22 19:47:01 +00:00
|
|
|
|
2020-08-07 20:20:30 +00:00
|
|
|
prereqlocal: installparallel startvm
|
2020-10-22 19:47:01 +00:00
|
|
|
${REQUIRE}
|
2024-01-21 06:53:12 +00:00
|
|
|
(parallel 'ssh -oStrictHostKeyChecking=accept-new vagrant@parallel-server{} mkdir -p bin; scp `which parallel` vagrant@parallel-server{}:bin/' ::: 1 2 3 4)&
|
2012-08-08 19:25:18 +00:00
|
|
|
|
2013-06-15 14:12:02 +00:00
|
|
|
prereqremote: installparallel startvm
|
2024-01-21 06:53:12 +00:00
|
|
|
parallel -j0 --timeout 10 --tag ssh -oStrictHostKeyChecking=accept-new vagrant@parallel-server{} parallel --minversion 20121021 ::: 1 2 || (echo parallel on remote required for testsuite; /bin/true)
|
2013-06-15 14:12:02 +00:00
|
|
|
|
2021-09-22 21:37:24 +00:00
|
|
|
ignore=bytes.of.data|ping.statistics|packets.transmitted|64.bytes.from|\
|
2024-01-21 06:53:12 +00:00
|
|
|
min/avg/max/mdev|default|known.hosts|Host.*found
|
2024-04-15 22:00:30 +00:00
|
|
|
start=(stdout ping -w 1 -c 1 {} && ssh vagrant@{} echo ssh {} works || \
|
2024-01-21 06:53:12 +00:00
|
|
|
(cd vagrant/*/{} 2>/dev/null && vagrant up ; \
|
|
|
|
echo {} | grep -q centos3 && \
|
|
|
|
(cat ../../authorized_keys | vagrant ssh -c "cat >>.ssh/authorized_keys"; \
|
|
|
|
vagrant ssh -c "sudo /sbin/ifconfig eth1 172.27.27.3"); \
|
|
|
|
ssh-keygen -R {}; \
|
2024-05-05 17:06:38 +00:00
|
|
|
stdout wssh -oStrictHostKeyChecking=accept-new vagrant@{} echo ssh {} started and works) ) | \
|
2021-09-22 21:37:24 +00:00
|
|
|
grep -Ev "${ignore}"
|
2024-01-21 06:53:12 +00:00
|
|
|
|
2021-09-22 21:37:24 +00:00
|
|
|
stop=(stdout ping -w 1 -c 1 {} && \
|
|
|
|
(cd vagrant/*/{} && vagrant suspend) ) | \
|
|
|
|
grep -Ev "${ignore}"
|
2013-06-15 14:12:02 +00:00
|
|
|
|
2024-08-21 20:37:15 +00:00
|
|
|
namedservers=centos9 freebsd13 freebsd14 rhel8 centos3
|
2024-01-21 06:53:12 +00:00
|
|
|
servers=parallel-server1 parallel-server2 parallel-server3 parallel-server4 ${namedservers}
|
|
|
|
|
2021-09-22 21:37:24 +00:00
|
|
|
startvm:
|
2024-04-15 22:00:30 +00:00
|
|
|
sort -u ~/.ssh/*.pub vagrant/authorized_keys > vagrant/authorized_keys.
|
|
|
|
mv vagrant/authorized_keys. vagrant/authorized_keys
|
2024-11-26 20:23:34 +00:00
|
|
|
parallel -j0 --tag -k --timeout 60 '${start}' ::: ${servers} &
|
2013-06-15 14:12:02 +00:00
|
|
|
stopvm:
|
2024-01-21 06:53:12 +00:00
|
|
|
parallel -j0 --tag -k '${stop}' ::: ${namedservers} || true
|
2012-05-05 22:20:10 +00:00
|
|
|
|
2024-07-21 03:21:21 +00:00
|
|
|
startdb:
|
|
|
|
sql oracle://SYSTEM:$$VM_ORACLE_PWD@/FREE "select 'Oracle is running' from dual;" || \
|
2024-11-26 20:23:34 +00:00
|
|
|
(cd vagrant-projects/OracleDatabase/23.3.0-Free && vagrant up && \
|
2024-07-21 03:21:21 +00:00
|
|
|
sql oracle://SYSTEM:$$VM_ORACLE_PWD@/FREE "select 'Oracle is running' from dual;")
|
2024-07-17 09:12:08 +00:00
|
|
|
stopdb:
|
2024-11-26 20:23:34 +00:00
|
|
|
cd vagrant-projects/OracleDatabase/23.3.0-Free; vagrant suspend
|
2024-07-17 09:12:08 +00:00
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
### Distribution
|
|
|
|
installparallel: ../src/parallel
|
|
|
|
cd .. && make -j && sudo make -j install
|
|
|
|
|
2010-10-06 20:45:24 +00:00
|
|
|
clean:
|
|
|
|
rm -rf input-files/random_dirs_no_newline
|
|
|
|
rm -rf input-files/random_dirs_with_newline
|
|
|
|
|
|
|
|
dist:
|
|
|
|
rm -rf input-files/random_dirs_*_newline || /bin/true
|
|
|
|
rm -rf tmp || /bin/true
|
|
|
|
( cd ..; tar -cvj --exclude .git --exclude '#*#' --exclude '*~' --exclude CVS -f /tmp/parallel.tar.bz2 parallel-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] )
|
|
|
|
mv /tmp/parallel.tar.bz2 parallel-$$(date +"%Y%m%d").tar.bz2
|
|
|
|
rsync -Havessh parallel-$$(date +"%Y%m%d").tar.bz2 download.savannah.nongnu.org:/releases/parallel/
|
|
|
|
|
2019-07-23 07:00:09 +00:00
|
|
|
### Measure timings
|
2012-05-27 15:51:09 +00:00
|
|
|
timings: tests-to-run/* ../src/parallel
|
2017-12-26 14:46:00 +00:00
|
|
|
ls tests-to-run/*.sh | parallel echo /usr/bin/time -f "'%e\ %P'" bash >/tmp/timing.script
|
2012-11-24 16:33:15 +00:00
|
|
|
stdout bash -x /tmp/timing.script | tee /tmp/timing.out
|
2014-12-29 23:31:02 +00:00
|
|
|
echo + .usr.bin.time_END >>/tmp/timing.out
|
|
|
|
perl -ne '/\+ .usr.bin.time/ and do { print $$last.$$h; $$h=$$_ }; chomp; s/.*\0//;$$last = $$_' /tmp/timing.out |sort -n >timings
|
2015-03-07 16:49:16 +00:00
|
|
|
|
|
|
|
timingbar:
|
2015-03-07 18:45:00 +00:00
|
|
|
vmstat 1 | timestamp --isotime > vmstat.timestamp.1 &
|
|
|
|
stdout make 1 | timestamp --isotime | tee make.timestamp.1
|
2015-03-07 16:49:16 +00:00
|
|
|
killall vmstat
|
|
|
|
mv vmstat.timestamp.1 vmstat.timestamp
|
|
|
|
mv make.timestamp.1 make.timestamp
|
|
|
|
sort vmstat.timestamp make.timestamp | perl -pe '/tests-to-run(\S+)/ and $$p=$$1; print "$$p "' | field 6,1,2 | perl -ne '/^\d+ / and print' | histogram -i vh
|