mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
11
Commits
4.4
...
bisect-cache
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58e31dbd22 | ||
|
|
85058b54a8 | ||
|
|
f16df142d7 | ||
|
|
f9f52a46a6 | ||
|
|
ef1bfb869f | ||
|
|
5002c74876 | ||
|
|
a0bc23c48f | ||
|
|
350cf6e578 | ||
|
|
b96a8d8766 | ||
|
|
a419828dea | ||
|
|
702b22d4a3 |
@@ -15,7 +15,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
# Verify we can build on latest Ubuntu with both gcc and clang
|
# Verify we can build on latest Ubuntu with both gcc and clang
|
||||||
name: ${{ matrix.compiler }}
|
name: ${{ matrix.compiler }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [gcc, clang]
|
compiler: [gcc, clang]
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ver=$(/tmp/sbin/initctl -V | awk '/Finit.*/ {print $2;}')
|
ver=$(/tmp/sbin/initctl -V | awk '/Finit.*/ {print $2;}')
|
||||||
dir=finit-$ver/_build/sub
|
dir=finit-$ver/_build/sub
|
||||||
make -j1 distcheck || (cat $dir/test/test-suite.log; false)
|
make -j1 distcheck || (cat $dir/test/setup-root.log; cat $dir/test/test-suite.log; false)
|
||||||
- name: Upload Test Results
|
- name: Upload Test Results
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -135,7 +135,7 @@ static void setup(void *arg)
|
|||||||
ln("/dev/shm", "/run/shm");
|
ln("/dev/shm", "/run/shm");
|
||||||
|
|
||||||
/* compat only, should really be set up by OS/dist */
|
/* compat only, should really be set up by OS/dist */
|
||||||
ln("/run", "/var/run");
|
ln("../run", "/var/run");
|
||||||
} else {
|
} else {
|
||||||
makedir("/var/lock", 1777);
|
makedir("/var/lock", 1777);
|
||||||
makedir("/var/run", 0755);
|
makedir("/var/run", 0755);
|
||||||
|
|||||||
@@ -160,19 +160,23 @@ static void sys_init(void *arg)
|
|||||||
char sysdir[MAX_ARG_LEN];
|
char sysdir[MAX_ARG_LEN];
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
|
_d("Calling mkpath() on sys conds");
|
||||||
if (mkpath(pid_runpath(_PATH_CONDSYS, sysdir, sizeof(sysdir)), 0755) && errno != EEXIST) {
|
if (mkpath(pid_runpath(_PATH_CONDSYS, sysdir, sizeof(sysdir)), 0755) && errno != EEXIST) {
|
||||||
_pe("Failed creating %s condition directory, %s", COND_SYS, _PATH_CONDSYS);
|
_pe("Failed creating %s condition directory, %s", COND_SYS, _PATH_CONDSYS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_d("Calling realpth() on condsys");
|
||||||
path = realpath(_PATH_CONDSYS, NULL);
|
path = realpath(_PATH_CONDSYS, NULL);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
_pe("Cannot figure out real path to %s, aborting", _PATH_CONDSYS);
|
_pe("Cannot figure out real path to %s, aborting", _PATH_CONDSYS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_d("Calling iwatch_add()");
|
||||||
if (iwatch_add(&iw_sys, path, IN_ONLYDIR))
|
if (iwatch_add(&iw_sys, path, IN_ONLYDIR))
|
||||||
iwatch_exit(&iw_sys);
|
iwatch_exit(&iw_sys);
|
||||||
|
_d("Done.");
|
||||||
}
|
}
|
||||||
|
|
||||||
static plugin_t plugin = {
|
static plugin_t plugin = {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
TEST_DIR=$(dirname "$0")
|
TEST_DIR=$(dirname "$0")
|
||||||
|
export DEBUG=1
|
||||||
|
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$TEST_DIR/tenv/lib.sh"
|
. "$TEST_DIR/tenv/lib.sh"
|
||||||
@@ -16,6 +17,11 @@ test_teardown()
|
|||||||
texec rm -f /test_assets/service.sh
|
texec rm -f /test_assets/service.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
say "Hi, this is /run et al"
|
||||||
|
texec sh -c "echo 'ROOT:/bin'; ls -l /bin/; echo 'ROOT:/sbin'; ls -l /sbin/; echo 'ROOT:/run'; ls -l /run/; echo 'ROOT:/run/finit/'; ls -l /run/finit/; echo 'ROOT:/dev'; ls -l /dev/; ps; ls -l /proc/1/fd/"
|
||||||
|
say "HUPing PID 1 ..."
|
||||||
|
texec sh -c "kill -HUP 1"
|
||||||
|
|
||||||
say "Test start $(date)"
|
say "Test start $(date)"
|
||||||
|
|
||||||
cp "$TEST_DIR"/common/service.sh "$TENV_ROOT"/test_assets/
|
cp "$TEST_DIR"/common/service.sh "$TENV_ROOT"/test_assets/
|
||||||
|
|||||||
@@ -12,3 +12,13 @@ FINITBIN="$(pwd)/$top_builddir/src/finit" DEST="$TENV_ROOT" make -f "$srcdir/ten
|
|||||||
for plugin in tty.so urandom.so rtc.so modprobe.so hotplug.so; do
|
for plugin in tty.so urandom.so rtc.so modprobe.so hotplug.so; do
|
||||||
find "$TENV_ROOT" -name $plugin -delete
|
find "$TENV_ROOT" -name $plugin -delete
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "$TENV_ROOT:"
|
||||||
|
ls -l "$TENV_ROOT"
|
||||||
|
echo "$TENV_ROOT:/bin"
|
||||||
|
ls -l "$TENV_ROOT"/bin
|
||||||
|
echo "$TENV_ROOT:/sbin"
|
||||||
|
ls -l "$TENV_ROOT"/sbin
|
||||||
|
echo "$TENV_ROOT:/var"
|
||||||
|
ls -l "$TENV_ROOT"/var/
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -154,10 +154,11 @@ if [ -n "${DEBUG:-}" ]; then
|
|||||||
FINIT_ARGS="${FINIT_ARGS:-} finit.debug=on"
|
FINIT_ARGS="${FINIT_ARGS:-} finit.debug=on"
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=2086
|
# shellcheck disable=2086
|
||||||
"$TEST_DIR/tenv/start.sh" finit ${FINIT_ARGS:-} &
|
"$TEST_DIR/tenv/start.sh" finit ${FINIT_ARGS:-} finit.debug=on &
|
||||||
finit_ppid=$!
|
finit_ppid=$!
|
||||||
echo "$finit_ppid" > "$TENV_ROOT"/running_test.pid
|
echo "$finit_ppid" > "$TENV_ROOT"/running_test.pid
|
||||||
|
|
||||||
|
>&2 echo "Finit runs as PID $finit_ppid outside of container."
|
||||||
>&2 echo "Hint: Execute 'TENV_ROOT=$TENV_ROOT $TEST_DIR/tenv/enter.sh' to enter the test namespace"
|
>&2 echo "Hint: Execute 'TENV_ROOT=$TENV_ROOT $TEST_DIR/tenv/enter.sh' to enter the test namespace"
|
||||||
log "$color_reset" 'Setup of test environment done' ''
|
log "$color_reset" 'Setup of test environment done' ''
|
||||||
|
|
||||||
@@ -169,4 +170,5 @@ fi
|
|||||||
|
|
||||||
#tty=/dev/$(texec cat /sys/class/tty/console/active)
|
#tty=/dev/$(texec cat /sys/class/tty/console/active)
|
||||||
#texec cat "$tty" &
|
#texec cat "$tty" &
|
||||||
#sleep 1
|
sleep 5
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user