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