[botanist] Prefix exposed environment variables with FUCHSIA_
This is to avoid clashing.
Change-Id: I269df7a6a9fd5a58aae6a29a2e3c530b5b8e5546
diff --git a/cmd/botanist/run.go b/cmd/botanist/run.go
index e8141e7..81ce2aa 100644
--- a/cmd/botanist/run.go
+++ b/cmd/botanist/run.go
@@ -133,8 +133,8 @@
env := append(
os.Environ(),
- fmt.Sprintf("NODENAME=%s", nodename),
- fmt.Sprintf("SSH_KEY=%s", string(privKeys[0])),
+ fmt.Sprintf("FUCHSIA_NODENAME=%s", nodename),
+ fmt.Sprintf("FUCHSIA_SSH_KEY=%s", string(privKeys[0])),
)
// Run command.
diff --git a/cmd/testrunner/main.go b/cmd/testrunner/main.go
index 1020250..ea0e467 100644
--- a/cmd/testrunner/main.go
+++ b/cmd/testrunner/main.go
@@ -95,7 +95,7 @@
Executes all tests found in the JSON [tests-file]
Fuchsia tests require both the nodename of the fuchsia instance and a private
SSH key corresponding to a authorized key to be set in the environment under
-NODENAME and SSH_KEY respectively.`)
+FUCHSIA_NODENAME and FUCHSIA_SSH_KEY respectively.`)
}
func init() {
@@ -136,13 +136,13 @@
}
}
- nodename := os.Getenv("NODENAME")
+ nodename := os.Getenv("FUCHSIA_NODENAME")
if nodename == "" {
- log.Printf("NODENAME not set")
+ log.Printf("FUCHSIA_NODENAME not set")
}
- sshKey := os.Getenv("SSH_KEY")
+ sshKey := os.Getenv("FUCHSIA_SSH_KEY")
if sshKey == "" {
- log.Printf("SSH_KEY not set")
+ log.Printf("FUCHSIA_SSH_KEY not set")
}
// Execute.
@@ -176,13 +176,13 @@
if nodename != "" {
localTester.env = append(
localTester.env,
- fmt.Sprintf("NODENAME=%s", nodename),
+ fmt.Sprintf("FUCHSIA_NODENAME=%s", nodename),
)
}
if sshKey != "" {
localTester.env = append(
localTester.env,
- fmt.Sprintf("SSH_KEY=%s", sshKey),
+ fmt.Sprintf("FUCHSIA_SSH_KEY=%s", sshKey),
)
}
@@ -221,9 +221,9 @@
}
if nodename == "" {
- return errors.New("NODENAME must be set")
+ return errors.New("FUCHSIA_NODENAME must be set")
} else if sshKey == "" {
- return errors.New("SSH_KEY must be set")
+ return errors.New("FUCHSIA_SSH_KEY must be set")
}
tester, err := NewFuchsiaTester(nodename, sshKey)
diff --git a/cmd/testrunner/tester_test.go b/cmd/testrunner/tester_test.go
index 2fcc79d..774aa0b 100644
--- a/cmd/testrunner/tester_test.go
+++ b/cmd/testrunner/tester_test.go
@@ -64,17 +64,17 @@
// Verifies that SSHTester can execute tests on a remote device. These tests are
// only meant for local verification. You can execute them like this:
//
-// NODENAME=<my nodename> SSH_KEY=<my key> go test ./...
+// FUCHSIA_NODENAME=<my nodename> FUCHSIA_SSH_KEY=<my key> go test ./...
func TestSSHTester(t *testing.T) {
t.Skip("ssh tests are meant for local testing only")
- nodename := os.Getenv("NODENAME")
+ nodename := os.Getenv("FUCHSIA_NODENAME")
if nodename == "" {
- t.Fatal("NODENAME not set")
+ t.Fatal("FUCHSIA_NODENAME not set")
}
- sshKey := os.Getenv("SSH_KEY")
+ sshKey := os.Getenv("FUCHSIA_SSH_KEY")
if sshKey == "" {
- t.Fatal("SSH_KEY not set")
+ t.Fatal("FUCHSIA_SSH_KEY not set")
}
cases := []struct {