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