mv contrib/cmd tests/cmd (except memfd-bind)

The following commands are moved from `contrib/cmd` to `tests/cmd`:
- fs-idmap
- pidfd-kill
- recvtty
- remap-rootfs
- sd-helper
- seccompagent

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2024-08-16 00:55:48 +09:00
parent 0377d50458
commit f76489f0af
14 changed files with 32 additions and 28 deletions

12
.gitignore vendored
View File

@@ -1,13 +1,13 @@
vendor/pkg
/runc
/runc-*
/contrib/cmd/recvtty/recvtty
/contrib/cmd/sd-helper/sd-helper
/contrib/cmd/seccompagent/seccompagent
/contrib/cmd/fs-idmap/fs-idmap
/contrib/cmd/memfd-bind/memfd-bind
/contrib/cmd/pidfd-kill/pidfd-kill
/contrib/cmd/remap-rootfs/remap-rootfs
/tests/cmd/recvtty/recvtty
/tests/cmd/sd-helper/sd-helper
/tests/cmd/seccompagent/seccompagent
/tests/cmd/fs-idmap/fs-idmap
/tests/cmd/pidfd-kill/pidfd-kill
/tests/cmd/remap-rootfs/remap-rootfs
man/man8
release
Vagrantfile

View File

@@ -78,22 +78,26 @@ runc-bin: runc-dmz
$(GO_BUILD) -o runc .
.PHONY: all
all: runc recvtty sd-helper seccompagent fs-idmap memfd-bind pidfd-kill remap-rootfs
all: runc memfd-bind recvtty sd-helper seccompagent fs-idmap pidfd-kill remap-rootfs
.PHONY: recvtty sd-helper seccompagent fs-idmap memfd-bind pidfd-kill remap-rootfs
recvtty sd-helper seccompagent fs-idmap memfd-bind pidfd-kill remap-rootfs:
.PHONY: memfd-bind
memfd-bind:
$(GO_BUILD) -o contrib/cmd/$@/$@ ./contrib/cmd/$@
.PHONY: recvtty sd-helper seccompagent fs-idmap pidfd-kill remap-rootfs
recvtty sd-helper seccompagent fs-idmap pidfd-kill remap-rootfs:
$(GO_BUILD) -o tests/cmd/$@/$@ ./tests/cmd/$@
.PHONY: clean
clean:
rm -f runc runc-* libcontainer/dmz/binary/runc-dmz
rm -f contrib/cmd/recvtty/recvtty
rm -f contrib/cmd/sd-helper/sd-helper
rm -f contrib/cmd/seccompagent/seccompagent
rm -f contrib/cmd/fs-idmap/fs-idmap
rm -f contrib/cmd/memfd-bind/memfd-bind
rm -f contrib/cmd/pidfd-kill/pidfd-kill
rm -f contrib/cmd/remap-rootfs/remap-rootfs
rm -f tests/cmd/recvtty/recvtty
rm -f tests/cmd/sd-helper/sd-helper
rm -f tests/cmd/seccompagent/seccompagent
rm -f tests/cmd/fs-idmap/fs-idmap
rm -f tests/cmd/pidfd-kill/pidfd-kill
rm -f tests/cmd/remap-rootfs/remap-rootfs
sudo rm -rf release
rm -rf man/man8

View File

@@ -351,4 +351,4 @@ a [Go implementation in the `go-runc` bindings][containerd/go-runc.Socket], as
well as [a simple client][recvtty].
[containerd/go-runc.Socket]: https://godoc.org/github.com/containerd/go-runc#Socket
[recvtty]: /contrib/cmd/recvtty
[recvtty]: /tests/cmd/recvtty

View File

@@ -14,7 +14,7 @@ import (
)
const (
usage = `Open Container Initiative contrib/cmd/pidfd-kill
usage = `Open Container Initiative tests/cmd/pidfd-kill
pidfd-kill is an implementation of a consumer of runC's --pidfd-socket API.
After received SIGTERM, pidfd-kill sends the given signal to init process by

View File

@@ -39,7 +39,7 @@ var version = ""
var gitCommit = ""
const (
usage = `Open Container Initiative contrib/cmd/recvtty
usage = `Open Container Initiative tests/cmd/recvtty
recvtty is a reference implementation of a consumer of runC's --console-socket
API. It has two main modes of operation:

View File

@@ -13,7 +13,7 @@ import (
"github.com/opencontainers/runtime-spec/specs-go"
)
const usage = `contrib/cmd/remap-rootfs
const usage = `tests/cmd/remap-rootfs
remap-rootfs is a helper tool to remap the root filesystem of a Open Container
Initiative bundle using user namespaces such that the file owners are remapped

View File

@@ -13,7 +13,7 @@ import (
)
func usage() {
fmt.Print(`Open Container Initiative contrib/cmd/sd-helper
fmt.Print(`Open Container Initiative tests/cmd/sd-helper
sd-helper is a tool that uses runc/libcontainer/cgroups/systemd package
functionality to communicate to systemd in order to perform various operations.

View File

@@ -17,7 +17,7 @@ make all
Run the seccomp agent in the background:
```bash
sudo ./contrib/cmd/seccompagent/seccompagent &
sudo ./tests/cmd/seccompagent/seccompagent &
```
Prepare a container:

View File

@@ -13,12 +13,12 @@ eval "$IMAGES"
unset IMAGES
: "${RUNC:="${INTEGRATION_ROOT}/../../runc"}"
RECVTTY="${INTEGRATION_ROOT}/../../contrib/cmd/recvtty/recvtty"
SD_HELPER="${INTEGRATION_ROOT}/../../contrib/cmd/sd-helper/sd-helper"
SECCOMP_AGENT="${INTEGRATION_ROOT}/../../contrib/cmd/seccompagent/seccompagent"
FS_IDMAP="${INTEGRATION_ROOT}/../../contrib/cmd/fs-idmap/fs-idmap"
PIDFD_KILL="${INTEGRATION_ROOT}/../../contrib/cmd/pidfd-kill/pidfd-kill"
REMAP_ROOTFS="${INTEGRATION_ROOT}/../../contrib/cmd/remap-rootfs/remap-rootfs"
RECVTTY="${INTEGRATION_ROOT}/../../tests/cmd/recvtty/recvtty"
SD_HELPER="${INTEGRATION_ROOT}/../../tests/cmd/sd-helper/sd-helper"
SECCOMP_AGENT="${INTEGRATION_ROOT}/../../tests/cmd/seccompagent/seccompagent"
FS_IDMAP="${INTEGRATION_ROOT}/../../tests/cmd/fs-idmap/fs-idmap"
PIDFD_KILL="${INTEGRATION_ROOT}/../../tests/cmd/pidfd-kill/pidfd-kill"
REMAP_ROOTFS="${INTEGRATION_ROOT}/../../tests/cmd/remap-rootfs/remap-rootfs"
# Some variables may not always be set. Set those to empty value,
# if unset, to avoid "unbound variable" error.

View File

@@ -214,7 +214,7 @@ function scmp_act_notify_template() {
@test "runc run [seccomp] (SCMP_ACT_NOTIFY example config)" {
# Run the script used in the seccomp agent example.
# This takes a bare config.json and modifies it to run an example.
"${INTEGRATION_ROOT}/../../contrib/cmd/seccompagent/gen-seccomp-example-cfg.sh"
"${INTEGRATION_ROOT}/../../tests/cmd/seccompagent/gen-seccomp-example-cfg.sh"
# The listenerPath the previous command uses is the default used by the
# seccomp agent. However, inside bats the socket is in a bats tmp dir.