test: add an LXC environment test #1286
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo/runner!1286
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mfenniak/forgejo-runner:test-lxc-environment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In preparation for a change to how commands are executed within the LXC environment, this PR introduces an "LXC Environment" test that verifies as many facets of the environment as I could imagine -- process cgroups, namespaces, working directory, environment variable access, user, and other signs of virtual environment availability.
ebcce20d84c122de2aaa@ -626,0 +637,4 @@- run: |set -x# /home... is expected for this workflow if pulled into a running system, and /tmp for the test environmentWhat is a "running system" in this context? My computer?
The first PWD check is intended to make this test pass when pulled out of the tests, put into Forgejo, and run with the runner, in a fully integrated normal Forgejo Actions system. The second is specific to the
TempDirlocation used in test execution.I've tried to clarify the comment. I could just remove the first clause as well, but obviously I developed this workflow by running it in Forgejo and then ported here since it was easier... due to my dumb editor trying to insist on tabs being used in a Go file. 🤣
Much better, thanks! Having this capability is great.
@ -626,0 +656,4 @@u=$(whoami)echo "Current user: $u"if [[ "$(whoami)" = "root" ]]; thenShould that be
"$u" = "root"?Yes, fixed.
@ -626,0 +671,4 @@ficurrent_proc=$(readlink /proc/$$/exe)if [[ "$current_proc" = "/usr/bin/bash" ]]; thenHow sure can we be that Bash is in
/usr/binand not in/binor somewhere else? What about[[ "$current_proc" = */bash ]?This test is only run on the defined labels in the test --
lxc:lxc://debian:bookworm. If that label changes, the test can be updated at the same time.Tests are currently failing due to external issues; will wait and see if they get resolved.
c122de2aaa69ce6327e569ce6327e52adbbd6c242adbbd6c2446a53188c246a53188c2b92fb4d160