2024-11-01 01:26:34 +00:00
|
|
|
From c25ad44b7cb50d470b1533931b7808cc194f0d50 Mon Sep 17 00:00:00 2001
|
2023-06-22 20:54:55 +00:00
|
|
|
From: Debarshi Ray <rishi@fedoraproject.org>
|
|
|
|
Date: Wed, 18 Aug 2021 17:55:21 +0200
|
|
|
|
Subject: [PATCH 1/2] cmd/run: Make sosreport work by setting the HOST
|
|
|
|
environment variable
|
|
|
|
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1940037
|
|
|
|
---
|
|
|
|
src/cmd/run.go | 1 +
|
|
|
|
1 file changed, 1 insertion(+)
|
|
|
|
|
|
|
|
diff --git a/src/cmd/run.go b/src/cmd/run.go
|
2024-11-01 01:26:34 +00:00
|
|
|
index 719c0d6abb20..92a097283f38 100644
|
2023-06-22 20:54:55 +00:00
|
|
|
--- a/src/cmd/run.go
|
|
|
|
+++ b/src/cmd/run.go
|
2024-11-01 01:26:34 +00:00
|
|
|
@@ -566,6 +566,7 @@ func constructExecArgs(container, preserveFDs string,
|
2023-06-22 20:54:55 +00:00
|
|
|
execArgs = append(execArgs, envOptions...)
|
|
|
|
|
|
|
|
execArgs = append(execArgs, []string{
|
|
|
|
+ "--env", "HOST=/run/host",
|
|
|
|
"--interactive",
|
|
|
|
"--preserve-fds", preserveFDs,
|
|
|
|
}...)
|
|
|
|
--
|
2024-11-01 01:26:34 +00:00
|
|
|
2.46.1
|
2023-06-22 20:54:55 +00:00
|
|
|
|
|
|
|
|
2024-11-01 01:26:34 +00:00
|
|
|
From e7877a4d1d38dc35aa6da6c012ec9a23397b7aa4 Mon Sep 17 00:00:00 2001
|
2023-06-22 20:54:55 +00:00
|
|
|
From: Debarshi Ray <rishi@fedoraproject.org>
|
|
|
|
Date: Fri, 10 Dec 2021 13:42:15 +0100
|
|
|
|
Subject: [PATCH 2/2] test/system: Update to test the migration path for
|
|
|
|
coreos/toolbox users
|
|
|
|
|
|
|
|
This reverts the changes to the tests made in commit
|
|
|
|
411147988b730dabf8b9e761a5426e12d648f008 by restoring commit
|
|
|
|
ca899c8a561f357ae32c6ba6813520fd8b682abb and the parts of commit
|
|
|
|
3aeb7cf288319e35eb9c5e26ea18d97452462c1e that were removed.
|
|
|
|
---
|
2024-11-01 01:26:34 +00:00
|
|
|
test/system/002-help.bats | 14 --------------
|
2023-06-22 20:54:55 +00:00
|
|
|
test/system/100-root.bats | 27 +++++++++++++++++++++++++++
|
2024-11-01 01:26:34 +00:00
|
|
|
2 files changed, 27 insertions(+), 14 deletions(-)
|
2023-06-22 20:54:55 +00:00
|
|
|
create mode 100644 test/system/100-root.bats
|
|
|
|
|
|
|
|
diff --git a/test/system/002-help.bats b/test/system/002-help.bats
|
2024-11-01 01:26:34 +00:00
|
|
|
index a8bfbc2c79d2..5dd14025ea0b 100644
|
2023-06-22 20:54:55 +00:00
|
|
|
--- a/test/system/002-help.bats
|
|
|
|
+++ b/test/system/002-help.bats
|
2024-11-01 01:26:34 +00:00
|
|
|
@@ -33,20 +33,6 @@ teardown() {
|
|
|
|
cleanup_all
|
2023-06-22 20:54:55 +00:00
|
|
|
}
|
|
|
|
|
2024-11-01 01:26:34 +00:00
|
|
|
-@test "help: Smoke test" {
|
|
|
|
- run --keep-empty-lines --separate-stderr "$TOOLBX"
|
2023-06-22 20:54:55 +00:00
|
|
|
-
|
|
|
|
- assert_failure
|
2024-11-01 01:26:34 +00:00
|
|
|
- assert [ ${#lines[@]} -eq 0 ]
|
|
|
|
- lines=("${stderr_lines[@]}")
|
2023-06-22 20:54:55 +00:00
|
|
|
- assert_line --index 0 "Error: missing command"
|
2024-11-01 01:26:34 +00:00
|
|
|
- assert_line --index 2 "create Create a new Toolbx container"
|
|
|
|
- assert_line --index 3 "enter Enter an existing Toolbx container"
|
|
|
|
- assert_line --index 4 "list List all existing Toolbx containers and images"
|
|
|
|
- assert_line --index 6 "Run 'toolbox --help' for usage."
|
|
|
|
- assert [ ${#stderr_lines[@]} -eq 7 ]
|
2023-06-22 20:54:55 +00:00
|
|
|
-}
|
|
|
|
-
|
2024-11-01 01:26:34 +00:00
|
|
|
@test "help: Command 'help'" {
|
2023-06-22 20:54:55 +00:00
|
|
|
if ! command -v man 2>/dev/null; then
|
2024-11-01 01:26:34 +00:00
|
|
|
skip "not found man(1)"
|
2023-06-22 20:54:55 +00:00
|
|
|
diff --git a/test/system/100-root.bats b/test/system/100-root.bats
|
|
|
|
new file mode 100644
|
2024-11-01 01:26:34 +00:00
|
|
|
index 000000000000..cf35d60ac25c
|
2023-06-22 20:54:55 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/test/system/100-root.bats
|
|
|
|
@@ -0,0 +1,27 @@
|
|
|
|
+#!/usr/bin/env bats
|
|
|
|
+
|
|
|
|
+load 'libs/bats-support/load'
|
|
|
|
+load 'libs/bats-assert/load'
|
|
|
|
+load 'libs/helpers'
|
|
|
|
+
|
|
|
|
+setup() {
|
|
|
|
+ _setup_environment
|
2024-11-01 01:26:34 +00:00
|
|
|
+ cleanup_all
|
2023-06-22 20:54:55 +00:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+teardown() {
|
2024-11-01 01:26:34 +00:00
|
|
|
+ cleanup_all
|
2023-06-22 20:54:55 +00:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+@test "root: Try to enter the default container with no containers created" {
|
2024-11-01 01:26:34 +00:00
|
|
|
+ run "$TOOLBX" <<< "n"
|
2023-06-22 20:54:55 +00:00
|
|
|
+
|
|
|
|
+ assert_success
|
|
|
|
+ assert_line --index 0 "No toolbox containers found. Create now? [y/N] A container can be created later with the 'create' command."
|
|
|
|
+ assert_line --index 1 "Run 'toolbox --help' for usage."
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+# TODO: Write the test
|
|
|
|
+@test "root: Enter the default container when 1 non-default container is present" {
|
|
|
|
+ skip "Testing of entering toolboxes is not implemented"
|
|
|
|
+}
|
|
|
|
--
|
2024-11-01 01:26:34 +00:00
|
|
|
2.46.1
|
2023-06-22 20:54:55 +00:00
|
|
|
|