Skip to content

Commit

Permalink
git subrepo pull (merge) external/os-autoinst-common
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "external/os-autoinst-common"
  merged:   "fbd66e7f6"
upstream:
  origin:   "git@github.com:os-autoinst/os-autoinst-common.git"
  branch:   "master"
  commit:   "fbd66e7f6"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"
Signed-off-by: ybonatakis <ybonatakis@suse.com>
  • Loading branch information
b10n1k committed Jan 29, 2024
1 parent 5adebbe commit 7bdab0c
Show file tree
Hide file tree
Showing 34 changed files with 167 additions and 166 deletions.
2 changes: 1 addition & 1 deletion container/openqa_data/scripts/set_openid
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ read OPENID
awk -v openid="$OPENID" '
/^provider/ {$0 = "provider = " openid}
{print}
' /data/conf/openqa.ini >/data/conf/openqa.ini.new
' /data/conf/openqa.ini > /data/conf/openqa.ini.new
mv /data/conf/openqa.ini.new /data/conf/openqa.ini

echo "The file now contains:"
Expand Down
2 changes: 1 addition & 1 deletion container/webui/nginx-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for i in $(seq "${OPENQA_WEBUI_REPLICAS:-2}"); do
done

reg="s/REPLICAS/$replicas_cfg/"
sed "$reg" /etc/nginx/nginx.conf.template >/etc/nginx/nginx.conf
sed "$reg" /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
echo 'NGINX configuration:'
cat /etc/nginx/nginx.conf

Expand Down
16 changes: 8 additions & 8 deletions container/webui/run_openqa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function all_together_apache() {
# run the database within the container if no database is configured by the user (by making one available via `-v`)
if [[ ! -e /data/conf/database.ini ]]; then
mkdir -p /data/conf
echo -e "[production]\ndsn = DBI:Pg:dbname=openqa" >/data/conf/database.ini
echo -e "[production]\ndsn = DBI:Pg:dbname=openqa" > /data/conf/database.ini
chown -R postgres:postgres /var/lib/pgsql # ensure right ownership in case `/var/lib/pgsql` is from host via `-v`
su postgres -c '/usr/share/postgresql/postgresql-script start'
su postgres -c '/usr/bin/openqa-setup-db'
Expand All @@ -63,11 +63,11 @@ usermod --shell /bin/sh geekotest

# run services
case "$MODE" in
upgradedb) upgradedb ;;
scheduler) scheduler ;;
websockets) websockets ;;
gru) gru ;;
livehandler) livehandler ;;
webui) webui ;;
*) all_together_apache ;;
upgradedb) upgradedb ;;
scheduler) scheduler ;;
websockets) websockets ;;
gru) gru ;;
livehandler) livehandler ;;
webui) webui ;;
*) all_together_apache ;;
esac
2 changes: 1 addition & 1 deletion container/worker/kvm-mknod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

kvm=$({ [[ -f /proc/config.gz ]] && test "$(zgrep CONFIG_KVM=y /proc/config.gz)"; } || true)
$kvm || lsmod | grep '\<kvm\>' >/dev/null || {
$kvm || lsmod | grep '\<kvm\>' > /dev/null || {
echo >&2 "KVM module not loaded; software emulation will be used"
exit 1
}
Expand Down
22 changes: 11 additions & 11 deletions container/worker/launch_workers_pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ size=1
cre="${cre:-"podman"}"

usage() {
cat <<EOF
cat << EOF
Usage: $0
To launch a pool of workers with the desired number of workers in individual
containers.
Expand All @@ -21,16 +21,16 @@ eval set -- "$opts"

while true; do
case "$1" in
-h | --help) usage 0 ;;
-s | --size)
size=$2
shift
;;
--)
shift
break
;;
*) break ;;
-h | --help) usage 0 ;;
-s | --size)
size=$2
shift
;;
--)
shift
break
;;
*) break ;;
esac
done

Expand Down
2 changes: 1 addition & 1 deletion container/worker/run_openqa_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p "/var/lib/openqa/pool/${OPENQA_WORKER_INSTANCE}/"
chown -R _openqa-worker /var/lib/openqa/pool/

if [[ -z $qemu_no_kvm ]] || [[ $qemu_no_kvm -eq 0 ]]; then
if [ -e "/dev/kvm" ] && getent group kvm >/dev/null; then
if [ -e "/dev/kvm" ] && getent group kvm > /dev/null; then
/root/qemu/kvm-mknod.sh

group=$(ls -lhn /dev/kvm | cut -d ' ' -f 4)
Expand Down
3 changes: 1 addition & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ devel_no_selenium_requires:
devel_requires:
'%devel_no_selenium_requires':
chromedriver:
shfmt:

main_requires:
'%assetpack_requires':
Expand Down Expand Up @@ -182,11 +181,11 @@ test_requires:
curl:
jq:
ShellCheck:
shfmt:
os-autoinst-devel:
postgresql-server:
python3-setuptools:
python3-yamllint:
shfmt:
perl(App::cpanminus):
perl(Perl::Critic):
perl(Perl::Critic::Freenode):
Expand Down
2 changes: 2 additions & 0 deletions external/os-autoinst-common/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
indent_style = space
indent_size = 4
binary_next_line = true
switch_case_indent = true
space_redirects = true

[.bpan/**]
ignore = true
Expand Down
4 changes: 2 additions & 2 deletions external/os-autoinst-common/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = git@github.com:os-autoinst/os-autoinst-common.git
branch = master
commit = ef465670789c9b49ce0e4e1f3da61c2cc313a0e0
parent = 6ca685738c5db7ccdd9394dec8d4841a293c65ec
commit = fbd66e7f61d2397f55bc8b6143a405c8ed639008
parent = 7f2e4f335e1ce7b7d89e5056da4acbb82b18bc94
method = merge
cmdver = 0.4.6
26 changes: 13 additions & 13 deletions script/configure-web-proxy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -e

usage() {
cat <<EOF
cat << EOF
Usage: configure-web-proxy
Configure a local web proxy for openQA.
Expand All @@ -18,29 +18,29 @@ eval set -- "$opts"
web_proxy="apache"
while true; do
case "$1" in
-h | --help) usage 0 ;;
-p | --proxy)
web_proxy=${2#*=}
shift
;;
--)
shift
break
;;
*) break ;;
-h | --help) usage 0 ;;
-p | --proxy)
web_proxy=${2#*=}
shift
;;
--)
shift
break
;;
*) break ;;
esac
done

sed -i -e 's/^.*httpsonly.*$/httpsonly = 0/g' /etc/openqa/openqa.ini

if [[ $web_proxy == "nginx" ]]; then
echo "Setting up nginx"
sed "s/openqa.example.com/$(hostname)/" /etc/nginx/vhosts.d/openqa.conf.template >/etc/nginx/vhosts.d/openqa.conf
sed "s/openqa.example.com/$(hostname)/" /etc/nginx/vhosts.d/openqa.conf.template > /etc/nginx/vhosts.d/openqa.conf
sed -i -e "s/\(^[^#]*server_name localhost;\)/#\1/" /etc/nginx/nginx.conf
elif [[ $web_proxy == "apache" || $web_proxy == "apache2" ]]; then
echo "Setting up apache"
for i in headers proxy proxy_http proxy_wstunnel rewrite; do a2enmod $i; done
sed "s/#ServerName.*$/ServerName $(hostname)/" /etc/apache2/vhosts.d/openqa.conf.template >/etc/apache2/vhosts.d/openqa.conf
sed "s/#ServerName.*$/ServerName $(hostname)/" /etc/apache2/vhosts.d/openqa.conf.template > /etc/apache2/vhosts.d/openqa.conf
else
echo "No supported proxy: $web_proxy"
exit 1
Expand Down
16 changes: 8 additions & 8 deletions script/openqa-auto-update
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -o pipefail

usage() {
cat <<EOF
cat << EOF
Usage: openqa-auto-update
Trigger automatic system upgrade and reboot if devel:openQA packages are stable
Expand All @@ -17,12 +17,12 @@ opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done

Expand All @@ -31,4 +31,4 @@ done
zypper -n ref
zypper -n --no-refresh dup --replacefiles --auto-agree-with-licenses --download-in-advance
# shellcheck disable=SC2015
needs-restarting --reboothint >/dev/null || (command -v rebootmgrctl >/dev/null && rebootmgrctl reboot || :)
needs-restarting --reboothint > /dev/null || (command -v rebootmgrctl > /dev/null && rebootmgrctl reboot || :)
14 changes: 7 additions & 7 deletions script/openqa-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ if [ -z "$skip_suse_tests" ]; then
fi

# ensure that the hostname is mapped to 127.0.0.1 (needed for livehandler)
grep -q "$(hostname)" /etc/hosts || echo "127.0.0.1 $(hostname)" >>/etc/hosts
grep -q "$(hostname)" /etc/hosts || echo "127.0.0.1 $(hostname)" >> /etc/hosts

# start daemons
if [ -z "$running_systemd" ]; then
pgrep -f openqa-scheduler-daemon >/dev/null || su geekotest -c /usr/share/openqa/script/openqa-scheduler-daemon &
pgrep -f openqa-websockets-daemon >/dev/null || su geekotest -c /usr/share/openqa/script/openqa-websockets-daemon &
pgrep -f openqa-gru >/dev/null || su geekotest -c /usr/share/openqa/script/openqa-gru &
pgrep -f openqa-livehandler-daemon >/dev/null || su geekotest -c /usr/share/openqa/script/openqa-livehandler-daemon &
pgrep -f openqa-scheduler-daemon > /dev/null || su geekotest -c /usr/share/openqa/script/openqa-scheduler-daemon &
pgrep -f openqa-websockets-daemon > /dev/null || su geekotest -c /usr/share/openqa/script/openqa-websockets-daemon &
pgrep -f openqa-gru > /dev/null || su geekotest -c /usr/share/openqa/script/openqa-gru &
pgrep -f openqa-livehandler-daemon > /dev/null || su geekotest -c /usr/share/openqa/script/openqa-livehandler-daemon &
if [[ $setup_web_proxy == "nginx" ]]; then
nginx
else
/usr/sbin/start_apache2 -k start
fi
pgrep -f openqa-webui-daemon >/dev/null || su geekotest -c /usr/share/openqa/script/openqa-webui-daemon &
pgrep -f openqa-webui-daemon > /dev/null || su geekotest -c /usr/share/openqa/script/openqa-webui-daemon &
else
if [[ $setup_web_proxy == "nginx" ]]; then
systemctl enable --now nginx
Expand All @@ -140,7 +140,7 @@ API_KEY=$(hexdump -n 8 -e '2/4 "%08X" 1 "\n"' /dev/random)
API_SECRET=$(hexdump -n 8 -e '2/4 "%08X" 1 "\n"' /dev/random)
echo "INSERT INTO api_keys (key, secret, user_id, t_created, t_updated) VALUES ('${API_KEY}', '${API_SECRET}', 2, NOW(), NOW());" | su postgres -c "psql $dbname"

cat >>/etc/openqa/client.conf <<EOF
cat >> /etc/openqa/client.conf << EOF
[localhost]
key = ${API_KEY}
secret = ${API_SECRET}
Expand Down
2 changes: 1 addition & 1 deletion script/openqa-bootstrap-container
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PKGS_TO_INSTALL="aaa_base systemd shadow zypper openSUSE-release vim iproute2 ip
zypper -n install systemd-container
mkdir -p /var/lib/machines/

cat >/etc/systemd/system/systemd-nspawn-openqa@.service <<EOF
cat > /etc/systemd/system/systemd-nspawn-openqa@.service << EOF
[Unit]
Description=Container %i
Documentation=man:systemd-nspawn(1)
Expand Down
14 changes: 7 additions & 7 deletions script/openqa-check-devel-repo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -o pipefail

usage() {
cat <<EOF
cat << EOF
Usage: openqa-check-devel-repo
Checks whether devel:openQA packages are stable
Expand All @@ -17,12 +17,12 @@ opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done

Expand Down
40 changes: 20 additions & 20 deletions script/openqa-clone-custom-git-refspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
clone_args="${clone_args:-"--skip-chained-deps --parental-inheritance --within-instance"}"

usage() {
cat <<EOF
cat << EOF
Usage:
openqa-clone-custom-git-refspec <github_pr_url> <openqa_job_url> [CUSTOM_TEST_VAR_1=foo] [CUSTOM_TEST_VAR_2=bar] ...
openqa-clone-custom-git-refspec <github_branch_url> <openqa_job_url> [CUSTOM_TEST_VAR_1=foo] [CUSTOM_TEST_VAR_2=bar] ...
Expand Down Expand Up @@ -59,24 +59,24 @@ opts=$(getopt -o vhnc: --long verbose,dry-run,help,clone-job-args: -n "$0" -- "$
eval set -- "$opts"
while true; do
case "$1" in
-v | --verbose)
set -x
shift
;;
-h | --help) usage 0 ;;
-n | --dry-run)
dry_run=true
shift
;;
-c | --clone-job-args)
clone_args="$2 $clone_args"
shift 2
;;
--)
shift
break
;;
*) break ;;
-v | --verbose)
set -x
shift
;;
-h | --help) usage 0 ;;
-n | --dry-run)
dry_run=true
shift
;;
-c | --clone-job-args)
clone_args="$2 $clone_args"
shift 2
;;
--)
shift
break
;;
*) break ;;
esac
done
job_list="${job:-"$2"}"
Expand Down Expand Up @@ -127,7 +127,7 @@ clone_job() {
local json_url=${host}/tests/${job}/file/vars.json
local json_data
json_data=$(eval "${curl_openqa} -s ${json_url}")
echo "$json_data" | jq . &>/dev/null \
echo "$json_data" | jq . &> /dev/null \
|| fail "Unreadable openQA job or no valid JSON data encountered. \
Please try 'curl $json_url' or select another job, e.g. in the same scenario: $host/t$job#next_previous"
local testsuite="${testsuite:-"$(echo "$json_data" | jq -r '.TEST')"}" || throw_json_error "$json_url" "$json_data"
Expand Down
14 changes: 7 additions & 7 deletions script/openqa-continuous-update
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -o pipefail

usage() {
cat <<EOF
cat << EOF
Usage: openqa-continous-update
Trigger system update if devel:openQA is stable and contains updates
Expand All @@ -17,12 +17,12 @@ opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done

Expand Down
Loading

0 comments on commit 7bdab0c

Please sign in to comment.