Skip to content

Commit 5d605cb

Browse files
committed
Move scripts around
1 parent 5b52f6a commit 5d605cb

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ clean:
116116
rm -f $(BIN)/$(NAME) $(PAM_MODULE) $(TOOLS) coverage.out $(COVERAGE_FILES) $(PAM_CONFIG)
117117

118118
###### Cgroup testdata ######
119-
.PHONY: generate-cgroupv1-testdata generate-cgroupv2-testdata
120-
generate-cgroupv1-testdata:
121-
bin/generate-cgroupv1-testdata
122-
generate-cgroupv2-testdata:
123-
bin/generate-cgroupv2-testdata
119+
.PHONY: gen-cgroupv1-testdata gen-cgroupv2-testdata
120+
gen-cgroupv1-testdata:
121+
bin/gen-cgroupv1-testdata
122+
gen-cgroupv2-testdata:
123+
bin/gen-cgroupv2-testdata
124124

125125
###### Go tests ######
126126
.PHONY: test test-setup test-teardown
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env bash
22
#
3-
# generate-cgroupv1-testdata - Generate cgroup v1 testdata by running
3+
# gen-cgroupv1-testdata - Generate cgroup v1 testdata by running
44
# bin/snapshot-cgroup inside Docker containers with known resource limits,
55
# inside a Lima VM running Ubuntu 20.04 (which uses cgroup v1 by default).
66
#
7-
# Usage: generate-cgroupv1-testdata
7+
# Usage: gen-cgroupv1-testdata
88
#
99
# Prerequisites:
1010
# Lima with a running "cgroupv1" instance:
11-
# limactl start --name=cgroupv1 bin/cgroupv1.yaml
11+
# limactl start --name=cgroupv1 cgroup/testdata/cgroupv1.yaml
1212
#
1313
# Each testdata directory contains:
1414
# expected.json - {"cpu_quota": <float>, "memory_limit": <int>}
@@ -28,7 +28,7 @@ ensure_lima_vm() {
2828
| jq -e "select(.name == \"$lima_instance\" and .status == \"Running\")" \
2929
>/dev/null 2>&1; then
3030
echo "Error: Lima instance '$lima_instance' is not running." >&2
31-
echo "Start it with: limactl start --name=$lima_instance bin/cgroupv1.yaml" >&2
31+
echo "Start it with: limactl start --name=$lima_instance cgroup/testdata/cgroupv1.yaml" >&2
3232
exit 1
3333
fi
3434
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22
#
3-
# generate-cgroupv2-testdata - Generate cgroup v2 testdata by running
3+
# gen-cgroupv2-testdata - Generate cgroup v2 testdata by running
44
# bin/snapshot-cgroup inside Docker containers with known resource limits.
55
#
6-
# Usage: generate-cgroupv2-testdata
6+
# Usage: gen-cgroupv2-testdata
77
#
88
# Prerequisites: Docker on a host running cgroup v2.
99
#

cgroup/cgroup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ type testdataExpected struct {
491491
// by bin/snapshot-cgroup. Each subdirectory of testdata/ is a separate test
492492
// case containing a proc/ and sys/ tree plus an expected.json.
493493
//
494-
// Regenerate with: bin/generate-cgroupv1-testdata and bin/generate-cgroupv2-testdata
494+
// Regenerate with: bin/gen-cgroupv1-testdata and bin/gen-cgroupv2-testdata
495495
func TestWithRootFromTestdata(t *testing.T) {
496496
entries, err := os.ReadDir("testdata")
497497
if err != nil {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# be launched with --cpus / --memory resource limits.
66
#
77
# Usage:
8-
# limactl start --name=cgroupv1 bin/cgroupv1.yaml
9-
# bin/generate-cgroupv1-testdata
8+
# limactl start --name=cgroupv1 cgroup/testdata/cgroupv1.yaml
9+
# bin/gen-cgroupv1-testdata
1010
# limactl stop cgroupv1 # when done
1111

1212
images:

0 commit comments

Comments
 (0)