tests: only generate key when not available yet
Installing a build key requires root permissions, something that is not possible in all cases, most notably on the builders. Instead of generating a key each time, which results in many keys being generated each test suite run, check whether a key is already present by using `abuild-sign --installed`, and only generate a key when that returns false.
This commit is contained in:
parent
a0d6085e9b
commit
2a95c3d50c
|
@ -12,7 +12,9 @@ setup() {
|
||||||
export PATH="$PWD/../:$PATH"
|
export PATH="$PWD/../:$PATH"
|
||||||
export ARCH=$(apk --print-arch)
|
export ARCH=$(apk --print-arch)
|
||||||
|
|
||||||
abuild-keygen -ain >/dev/null 2>&1
|
if ! abuild-sign --installed 2>/dev/null; then
|
||||||
|
abuild-keygen -ain >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$tmpdir" "$WORKDIR"
|
mkdir -p "$tmpdir" "$WORKDIR"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,9 @@ setup() {
|
||||||
export APORTSDIR="$PWD"/testrepo
|
export APORTSDIR="$PWD"/testrepo
|
||||||
export PATH="$PWD/../:$PATH"
|
export PATH="$PWD/../:$PATH"
|
||||||
|
|
||||||
abuild-keygen -ain >/dev/null 2>&1
|
if ! abuild-sign --installed 2>/dev/null; then
|
||||||
|
abuild-keygen -ain >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$tmpdir" "$WORKDIR"
|
mkdir -p "$tmpdir" "$WORKDIR"
|
||||||
printf "[color]\n\tui = always\n" > "$GIT_CONFIG_GLOBAL"
|
printf "[color]\n\tui = always\n" > "$GIT_CONFIG_GLOBAL"
|
||||||
|
|
Loading…
Reference in New Issue