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