diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9abcb32..00edab6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: write steps: diff --git a/.github/workflows/tunasync.yml b/.github/workflows/tunasync.yml index cfc15a6..9ca1a84 100644 --- a/.github/workflows/tunasync.yml +++ b/.github/workflows/tunasync.yml @@ -6,7 +6,7 @@ jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out code into the Go module directory @@ -36,7 +36,7 @@ jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: registry: image: registry:2 @@ -59,14 +59,6 @@ jobs: go-version: '^1.22' id: go - - name: Run Unit tests. - run: | - go install github.com/wadey/gocovmerge@latest - sudo systemd-run --service-type=oneshot --uid="$(id --user)" --pipe --wait \ - --property=Delegate=yes --setenv=USECURCGROUP=1 \ - --setenv=TERM=xterm-256color --same-dir \ - make test - - name: Run Additional Unit tests. run: | make build-test-worker @@ -196,7 +188,23 @@ jobs: cgcreate -a "$CUSER" -t "$CUSER" -g memory:tunasync TERM=xterm-256color ./worker.test -test.v=true -test.coverprofile \ profile3.cov -test.run TestCgroup + cgexec -g "*:/" bash -c "echo Debug1" + cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=0 TERM=xterm-256color echo Debug2" + cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=0 TERM=xterm-256color cgexec -g cpu,memory:tunasync echo Debug3" cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=1 TERM=xterm-256color cgexec -g cpu,memory:tunasync ./worker.test -test.v=true -test.coverprofile profile4.cov -test.run TestCgroup" + echo "Debug4" + EOF + + - name: Run Tests in Cgroupv1 + run: | + CUSER="$(id --user --name)" + sudo rsh 254.255.255.2 bash --noprofile --norc << EOF + cd "/home/${CUSER}" + lssubsys -am + ls -la /sys/fs/cgroup/cpu/tunasync + ls -la /sys/fs/cgroup/memory/tunasync + strace -f cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=0 TERM=xterm-256color cgexec -g cpu,memory:tunasync echo Debug3" + echo "Debug4" EOF - name: Stop Uml diff --git a/.umlrootfs/Dockerfile b/.umlrootfs/Dockerfile index 8026f67..59a5663 100644 --- a/.umlrootfs/Dockerfile +++ b/.umlrootfs/Dockerfile @@ -1,5 +1,5 @@ -FROM debian:bullseye -RUN apt-get update && apt-get install -y systemd rsh-redone-server ifupdown sudo kmod cgroup-tools systemd-sysv +FROM debian:bookworm +RUN apt-get update && apt-get install -y systemd rsh-redone-server ifupdown sudo kmod cgroup-tools systemd-sysv strace RUN echo "host" > /root/.rhosts && \ chmod 600 /root/.rhosts && \ /bin/echo -e "auto eth0\niface eth0 inet static\naddress 254.255.255.2/24" > /etc/network/interfaces.d/eth0 && \