Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
shankerwangmiao committed Jan 11, 2025
1 parent 181fddb commit b1efe60
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/tunasync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
services:
registry:
image: registry:2
Expand All @@ -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
Expand Down Expand Up @@ -196,7 +188,24 @@ 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
exec 2>&1
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
Expand Down
4 changes: 2 additions & 2 deletions .umlrootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down

0 comments on commit b1efe60

Please sign in to comment.