a1353c
From cc15d0ac76fa77a2fa0f3c73e1a3ed4e7ceb2b29 Mon Sep 17 00:00:00 2001
a1353c
From: Debarshi Ray <rishi@fedoraproject.org>
a1353c
Date: Wed, 18 Aug 2021 17:55:21 +0200
a1353c
Subject: [PATCH 1/2] cmd/run: Make sosreport work by setting the HOST
a1353c
 environment variable
a1353c
a1353c
https://bugzilla.redhat.com/show_bug.cgi?id=1940037
a1353c
---
a1353c
 src/cmd/run.go | 1 +
a1353c
 1 file changed, 1 insertion(+)
a1353c
a1353c
diff --git a/src/cmd/run.go b/src/cmd/run.go
a1353c
index 5954eac55fad..ca363815d4c9 100644
a1353c
--- a/src/cmd/run.go
a1353c
+++ b/src/cmd/run.go
a1353c
@@ -441,6 +441,7 @@ func constructExecArgs(container string,
a1353c
 	execArgs = append(execArgs, detachKeys...)
a1353c
 
a1353c
 	execArgs = append(execArgs, []string{
a1353c
+		"--env", "HOST=/run/host",
a1353c
 		"--interactive",
a1353c
 		"--tty",
a1353c
 		"--user", currentUser.Username,
a1353c
-- 
a1353c
2.39.1
a1353c
a1353c
a1353c
From a47cd46e0ca32b8af0ea8181c856ce2a8d8307fd Mon Sep 17 00:00:00 2001
a1353c
From: Debarshi Ray <rishi@fedoraproject.org>
a1353c
Date: Fri, 10 Dec 2021 13:42:15 +0100
a1353c
Subject: [PATCH 2/2] test/system: Update to test the migration path for
a1353c
 coreos/toolbox users
a1353c
a1353c
This reverts the changes to the tests made in commit
a1353c
411147988b730dabf8b9e761a5426e12d648f008 by restoring commit
a1353c
ca899c8a561f357ae32c6ba6813520fd8b682abb and the parts of commit
a1353c
3aeb7cf288319e35eb9c5e26ea18d97452462c1e that were removed.
a1353c
---
a1353c
 test/system/002-help.bats | 11 -----------
a1353c
 test/system/100-root.bats | 27 +++++++++++++++++++++++++++
a1353c
 2 files changed, 27 insertions(+), 11 deletions(-)
a1353c
 create mode 100644 test/system/100-root.bats
a1353c
a1353c
diff --git a/test/system/002-help.bats b/test/system/002-help.bats
a1353c
index 689f95e472a1..525d44431ee5 100644
a1353c
--- a/test/system/002-help.bats
a1353c
+++ b/test/system/002-help.bats
a1353c
@@ -8,17 +8,6 @@ setup() {
a1353c
   _setup_environment
a1353c
 }
a1353c
 
a1353c
-@test "help: Try to run toolbox with no command" {
a1353c
-  run $TOOLBOX
a1353c
-
a1353c
-  assert_failure
a1353c
-  assert_line --index 0 "Error: missing command"
a1353c
-  assert_line --index 1 "create    Create a new toolbox container"
a1353c
-  assert_line --index 2 "enter     Enter an existing toolbox container"
a1353c
-  assert_line --index 3 "list      List all existing toolbox containers and images"
a1353c
-  assert_line --index 4 "Run 'toolbox --help' for usage."
a1353c
-}
a1353c
-
a1353c
 @test "help: Run command 'help'" {
a1353c
   if ! command -v man 2>/dev/null; then
a1353c
     skip "Test works only if man is in PATH"
a1353c
diff --git a/test/system/100-root.bats b/test/system/100-root.bats
a1353c
new file mode 100644
a1353c
index 000000000000..32d87904213e
a1353c
--- /dev/null
a1353c
+++ b/test/system/100-root.bats
a1353c
@@ -0,0 +1,27 @@
a1353c
+#!/usr/bin/env bats
a1353c
+
a1353c
+load 'libs/bats-support/load'
a1353c
+load 'libs/bats-assert/load'
a1353c
+load 'libs/helpers'
a1353c
+
a1353c
+setup() {
a1353c
+  _setup_environment
a1353c
+  cleanup_containers
a1353c
+}
a1353c
+
a1353c
+teardown() {
a1353c
+  cleanup_containers
a1353c
+}
a1353c
+
a1353c
+@test "root: Try to enter the default container with no containers created" {
a1353c
+  run $TOOLBOX <<< "n"
a1353c
+
a1353c
+  assert_success
a1353c
+  assert_line --index 0 "No toolbox containers found. Create now? [y/N] A container can be created later with the 'create' command."
a1353c
+  assert_line --index 1 "Run 'toolbox --help' for usage."
a1353c
+}
a1353c
+
a1353c
+# TODO: Write the test
a1353c
+@test "root: Enter the default container when 1 non-default container is present" {
a1353c
+  skip "Testing of entering toolboxes is not implemented"
a1353c
+}
a1353c
-- 
a1353c
2.39.1
a1353c