-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathboulder-concurrency-test.yaml
More file actions
44 lines (42 loc) · 1.29 KB
/
boulder-concurrency-test.yaml
File metadata and controls
44 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-FileCopyrightText: 2024 AerynOS Developers
# SPDX-License-Identifier: MPL-2.0
name : boulder-concurrency-test
version : 1
release : 1
homepage : https://github.com/serpent-os/moss
summary : Concurrency test for boulder
description: Concurrency test for boulder
license :
- MPL-2.0
setup : |
# shuf generates a single number within the range
for f in a b c d e f g h
do
touch "$f" && sleep $(shuf -i 1-5 -n1)
done
build : |
[[ -f build.log ]] && rm build.log
for f in a b c d e f g h
do
echo "$(shuf -i 1-10000 -n1)" > "$f" && echo "$f: $(cat $f)" >> build.log && sleep $(shuf -i 1-5 -n1)
done
cat << EOF > test_values.sh
#!/usr/bin/env bash
#
set -euo pipefail
[[ -f build.log ]] || exit 1
for a b c d e f g h
do
[[ -f "$f" ]]
echo -e "testing $f: $(grep $f build.log |cut -f2 -d':') == $(cat $f)? "
[[ "$(grep $f build.log |cut -f2 -d':')" == "$(cat $f)" ]] && echo -e "True\n" || echo -e "False\n"
done
EOF
install : |
%install_dir %(installroot)%(libexecdir)
for f in a b c d e f g h
do
%install_file $f %(installroot)%(libexecdir)/$f && sleep $(shuf -i 1-5 -n1)
%install_file build.log %(installroot)%(libexecdir)/build.log
%install_exe test_values.sh %(installroot)%(libexecdir)/test_values.sh
done