Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run aarch64 tests native via actuated #2431

Merged
merged 5 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/actuated-aarch64-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Actuated aarch64 test

on: [push, pull_request]

# Cancel any preceding run on the pull request.
concurrency:
group: actuated-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }}

jobs:
build:
# Actuated runners are not available in all repositories.
if: ${{ github.repository == 'checkpoint-restore/criu' }}
# The memory size and the number of CPUs can be freely selected.
# 3GB and 4 CPUs seems to be enough according to the result from 'vmmeter'.
runs-on: actuated-arm64-4cpu-3gb
strategy:
matrix:
target: [GCC=1, CLANG=1]

steps:
# https://gist.github.com/alexellis/1f33e581c75e11e161fe613c46180771#file-metering-gha-md
# vmmeter start
- name: Prepare arkade
uses: alexellis/arkade-get@master
with:
crane: latest
print-summary: false

- name: Install vmmeter
run: |
crane export --platform linux/arm64 ghcr.io/openfaasltd/vmmeter:latest | sudo tar -xvf - -C /usr/local/bin

- name: Run vmmeter
uses: self-actuated/vmmeter-action@master
# vmmeter end

- uses: actions/checkout@v4
- name: Run Tests ${{ matrix.target }}
# Following tests are failing on the actuated VMs:
# ./change_mnt_context --pidfile=change_mnt_context.pid --outfile=change_mnt_context.out
# 45: ERR: change_mnt_context.c:23: mount (errno = 22 (Invalid argument))
#
# In combination with '--remote-lazy-pages' following error occurs:
# 138: FAIL: maps05.c:84: Data corrupted at page 1639 (errno = 11 (Resource temporarily unavailable))
run: |
# The 'sched_policy00' needs the following:
sudo sysctl -w kernel.sched_rt_runtime_us=-1
# etc/hosts entry is needed for netns_lock_iptables
echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts
sudo -E make -C scripts/ci local ${{ matrix.target }} RUN_TESTS=1 \
ZDTM_OPTS="-x zdtm/static/change_mnt_context -x zdtm/static/maps05"
5 changes: 5 additions & 0 deletions coredump/coredump
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import platform
import argparse
import os
import sys
Expand Down Expand Up @@ -36,6 +37,10 @@ def main():

opts = vars(parser.parse_args())

if platform.machine() != 'x86_64':
print('ERROR: %s only supported on x86_64' % sys.argv[0])
sys.exit(1)

try:
coredump(opts)
except SystemExit as error:
Expand Down
4 changes: 2 additions & 2 deletions crit/crit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ def explore_rss(opts):
pvmi = -1
for pm in pms[1:]:
pstr = '\t%lx / %-8d' % (pm['vaddr'], pm['nr_pages'])
while vmas[vmi]['end'] <= pm['vaddr']:
while vmi < len(vmas) and vmas[vmi]['end'] <= pm['vaddr']:
vmi += 1

pme = pm['vaddr'] + (pm['nr_pages'] << 12)
vstr = ''
while vmas[vmi]['start'] < pme:
while vmi < len(vmas) and vmas[vmi]['start'] < pme:
vma = vmas[vmi]
if vmi == pvmi:
vstr += ' ~'
Expand Down
8 changes: 8 additions & 0 deletions test/others/criu-coredump/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ function run_test {
echo "= done"
}

UNAME_M=$(uname -m)

if [ "$UNAME_M" != "x86_64" ]; then
# the criu-coredump script is only x86_64 aware
echo "criu-coredump only support x86_64. skipping."
exit 0
fi

gen_imgs
run_test
5 changes: 5 additions & 0 deletions test/others/ns_ext/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -x

if ! ../../zdtm/static/macvlan.checkskip; then
echo "No macvlan support. Skipping"
exit 0
fi

if [[ "$1" == "pid" ]]; then
NS=pid
else
Expand Down
38 changes: 38 additions & 0 deletions test/zdtm/static/macvlan.checkskip
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

FAIL=0

create_macvlan_device() {
if ! ip link add test_mvlan1 type veth >/dev/null 2>&1; then
FAIL=1
fi
if ! ip link add mymacvlan1 link test_mvlan1 type macvlan >/dev/null 2>&1; then
FAIL=1
fi

return "${FAIL}"
}

cleanup() {
ip link del test_mvlan1 >/dev/null 2>&1
ip link del mymacvlan1 >/dev/null 2>&1
}

trap "cleanup" QUIT TERM INT HUP EXIT

# Test once without loading the module
if create_macvlan_device; then
exit 0
fi

# Test once more with explicitly loading the module
if ! modprobe macvlan >/dev/null 2>&1; then
exit 1
fi
create_macvlan_device

if [ "${FAIL}" == "1" ]; then
exit 1
fi

exit 0
13 changes: 13 additions & 0 deletions test/zdtm/static/selinux00.checkskip
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

test -d /sys/fs/selinux || exit 1

# check if necessary commands are installed
if ! command -v setenforce &>/dev/null; then
exit 1
fi

if ! command -v setsebool &>/dev/null; then
exit 1
fi

if ! command -v getsebool &>/dev/null; then
exit 1
fi

# See selinux00.hook for details

getsebool unconfined_dyntrans_all > /dev/null 2>&1
Expand Down
Loading