Skip to content

Commit

Permalink
Merge pull request #4377 from AkihiroSuda/distro-should-not-install-r…
Browse files Browse the repository at this point in the history
…ecvtty-etc

mv contrib/cmd tests/cmd (except memfd-bind)
  • Loading branch information
rata authored Aug 21, 2024
2 parents 376e875 + f76489f commit 41831e7
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,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

Expand Down
2 changes: 1 addition & 1 deletion docs/terminals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/seccomp-notify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 41831e7

Please sign in to comment.