Lines Matching +full:gitlab +full:- +full:ci

2 # SPDX-License-Identifier: GPL-2.0
8 # * virtme-ng
9 # * busybox-static (used by virtme-ng)
10 # * qemu (used by virtme-ng)
12 readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
27 --pidfile ${QEMU_PIDFILE} \
35 "Run the hid-tools test-suite in the VM."
49 echo "$0 [OPTIONS] [TEST]... [-- tests-args]"
53 echo " -b: build the kernel from the current source tree and use it for guest VMs"
54 echo " -H: hostname for remote build host (used with -b)"
55 echo " -p: podman container name for remote build host (used with -b)"
56 echo " Example: -H beefyserver -p vng"
57 echo " -q: set the path to or name of qemu binary"
58 echo " -s: start a shell in the VM instead of running tests"
59 echo " -v: more verbose output (can be repeated multiple times)"
66 printf "\t%-35s%-35s\n" "${name}" "${desc}"
79 # vng --ssh-client keeps shouting "Warning: Permanently added 'virtme-ng%22'
81 # So replace the command with what's actually called and add the "-q" option
82 stdbuf -oL ssh -q \
83 -F ${HOME}/.cache/virtme-ng/.ssh/virtme-ng-ssh.conf \
84 -l root virtme-ng%${SSH_GUEST_PORT} \
90 if [[ -s "${QEMU_PIDFILE}" ]]; then
91 pkill -SIGTERM -F "${QEMU_PIDFILE}" > /dev/null 2>&1
96 if [[ -e "${QEMU_PIDFILE}" ]]; then
113 if [[ "${found}" -eq 0 ]]; then
120 if ! command -v > /dev/null "test_${arg}"; then
129 if [[ ! -x $(command -v "${dep}") ]]; then
130 echo -e "skip: dependency ${dep} not found!\n"
135 if [[ ! -x $(command -v "${HID_BPF_TEST}") ]]; then
141 if [[ ! -x $(command -v "${HIDRAW_TEST}") ]]; then
154 version="$(vng --version)"
164 if [[ ! "${ok}" -eq 1 ]]; then
172 if [[ ! "${BUILD}" -eq 1 ]]; then
176 if [[ ! -d "${KERNEL_CHECKOUT}" ]]; then
177 echo "-b requires vmtest.sh called from the kernel source tree" >&2
183 if ! vng --kconfig --config "${SCRIPT_DIR}"/config; then
187 local vng_args=("-v" "--config" "${SCRIPT_DIR}/config" "--build")
189 if [[ -n "${BUILD_HOST}" ]]; then
190 vng_args+=("--build-host" "${BUILD_HOST}")
193 if [[ -n "${BUILD_HOST_PODMAN_CONTAINER_NAME}" ]]; then
194 vng_args+=("--build-host-exec-prefix" \
195 "podman exec -ti ${BUILD_HOST_PODMAN_CONTAINER_NAME}")
202 if ! make -j$(nproc) -C "${HID_BPF_PROGS}"; then
206 if ! make -j$(nproc) -C "${SCRIPT_DIR}"; then
219 qemu=$(command -v "${QEMU}")
221 if [[ "${VERBOSE}" -eq 2 ]]; then
222 verbose_opt="--verbose"
233 --run \
236 --qemu-opts="${QEMU_OPTS}" \
237 --qemu="${qemu}" \
238 --user root \
239 --append "${KERNEL_CMDLINE}" \
240 --ssh "${SSH_GUEST_PORT}" \
241 --rw &> ${logfile} &
246 while [[ ! -s "${QEMU_PIDFILE}" ]]; do
247 if ! kill -0 "${vng_pid}" 2>/dev/null; then
252 if [[ ${elapsed} -ge ${WAIT_TOTAL} ]]; then
267 if [[ ${i} -gt ${WAIT_PERIOD_MAX} ]]; then
270 if vm_ssh -- true; then
279 vm_ssh -- mount bpffs -t bpf /sys/fs/bpf
283 stdbuf -oL awk '{ printf "%s:\t%s\n","'"${prefix}"'", $0; fflush() }'
298 if [[ ${verbose} -le 0 ]]; then
304 if [[ "$#" -eq 0 ]]; then
305 __log_stdin | tee -a "${LOG}" > ${redirect}
307 __log_args "$@" | tee -a "${LOG}" > ${redirect}
312 log $((VERBOSE-1)) "setup" "$@"
319 log $((VERBOSE-1)) "test:${testname}:host" "$@"
332 vm_ssh -- "${HID_BPF_TEST}" \
341 vm_ssh -- "${HIDRAW_TEST}" \
352 vm_ssh -- pytest ${SCRIPT_DIR}/tests --color=yes "$@" \
366 vm_oops_cnt_before=$(vm_ssh -- dmesg | grep -c -i 'Oops')
367 vm_error_cnt_before=$(vm_ssh -- dmesg --level=err | wc -l)
373 vm_oops_cnt_after=$(vm_ssh -- dmesg | grep -i 'Oops' | wc -l)
374 if [[ ${vm_oops_cnt_after} -gt ${vm_oops_cnt_before} ]]; then
379 vm_error_cnt_after=$(vm_ssh -- dmesg --level=err | wc -l)
380 if [[ ${vm_error_cnt_after} -gt ${vm_error_cnt_before} ]]; then
382 vm_ssh -- dmesg --level=err | log_host "${name}"
389 QEMU="qemu-system-$(uname -m)"
403 shift $((OPTIND-1))
409 if [[ ${#} -eq 0 ]]; then
416 if [[ x"$arg" == x"--" ]]; then
425 if [[ "${SHELL_MODE}" -eq 0 ]]; then
439 if [[ "${SHELL_MODE}" -eq 1 ]]; then
443 vm_ssh -t -- "cd '${CURRENT_DIR}' && exec bash -l"
454 if [[ ${rc} -eq $KSFT_PASS ]]; then
457 elif [[ ${rc} -eq $KSFT_SKIP ]]; then
460 elif [[ ${rc} -eq $KSFT_FAIL ]]; then
470 if [ $((cnt_pass + cnt_skip)) -eq ${cnt_total} ]; then