Merge "services/mgmt: More VEYRON_* --> V23_* environment variable renames."
diff --git a/cmd/mgmt/shell.sh b/cmd/mgmt/shell.sh
index b5d9b59..d55c678 100755
--- a/cmd/mgmt/shell.sh
+++ b/cmd/mgmt/shell.sh
@@ -13,9 +13,9 @@
set -u
TMPDIR="${TMPDIR-/tmp}"
-VEYRON_SHELL_TMP_DIRS=${VEYRON_SHELL_TMP_DIRS-$(mktemp "${TMPDIR}/XXXXXXXX")}
-VEYRON_SHELL_TMP_FILES=${VEYRON_SHELL_TMP_FILES-$(mktemp "${TMPDIR}/XXXXXXXX")}
-VEYRON_SHELL_TMP_PIDS=${VEYRON_SHELL_TMP_PIDS-$(mktemp "${TMPDIR}/XXXXXXXX")}
+V23_SHELL_TMP_DIRS=${V23_SHELL_TMP_DIRS-$(mktemp "${TMPDIR}/XXXXXXXX")}
+V23_SHELL_TMP_FILES=${V23_SHELL_TMP_FILES-$(mktemp "${TMPDIR}/XXXXXXXX")}
+V23_SHELL_TMP_PIDS=${V23_SHELL_TMP_PIDS-$(mktemp "${TMPDIR}/XXXXXXXX")}
trap shell::at_exit INT TERM EXIT
@@ -29,10 +29,10 @@
# for example, to garbage collect any temporary files and directories
# created by invocations of shell::tmp_file and shell:tmp_dir.
shell::at_exit() {
- # If the variable VEYRON_SHELL_CMD_LOOP_AT_EXIT is non-empty, accept commands
+ # If the variable V23_SHELL_CMD_LOOP_AT_EXIT is non-empty, accept commands
# from the user in a command loop. This can preserve the state in the logs
# directories while the user examines them.
- case "${VEYRON_SHELL_CMD_LOOP_AT_EXIT-}" in
+ case "${V23_SHELL_CMD_LOOP_AT_EXIT-}" in
?*)
local cmdline
set +u
@@ -45,16 +45,16 @@
esac
# Unset the trap so that it doesn't run again on exit.
trap - INT TERM EXIT
- for pid in $(cat "${VEYRON_SHELL_TMP_PIDS}"); do
+ for pid in $(cat "${V23_SHELL_TMP_PIDS}"); do
sudo -u "${SUDO_USER}" kill "${pid}" &> /dev/null || true
done
- for tmp_dir in $(cat "${VEYRON_SHELL_TMP_DIRS}"); do
+ for tmp_dir in $(cat "${V23_SHELL_TMP_DIRS}"); do
sudo -u "${SUDO_USER}" rm -rf "${tmp_dir}" &>/dev/null
done
- for tmp_file in $(cat "${VEYRON_SHELL_TMP_FILES}"); do
+ for tmp_file in $(cat "${V23_SHELL_TMP_FILES}"); do
sudo -u "${SUDO_USER}" rm -f "${tmp_file}" &>/dev/null
done
- sudo -u "${SUDO_USER}" rm -f "${VEYRON_SHELL_TMP_DIRS}" "${VEYRON_SHELL_TMP_FILES}" "${VEYRON_SHELL_TMP_PIDS}" &>/dev/null
+ sudo -u "${SUDO_USER}" rm -f "${V23_SHELL_TMP_DIRS}" "${V23_SHELL_TMP_FILES}" "${V23_SHELL_TMP_PIDS}" &>/dev/null
}
# shell::kill_child_processes kills all child processes.
@@ -136,7 +136,7 @@
# local -R TMP_DIR=$(shell::tmp_dir)
shell::tmp_dir() {
local -r RESULT=$(mktemp -d "${TMPDIR}/XXXXXXXX")
- echo "${RESULT}" >> "${VEYRON_SHELL_TMP_DIRS}"
+ echo "${RESULT}" >> "${V23_SHELL_TMP_DIRS}"
echo "${RESULT}"
}
@@ -146,7 +146,7 @@
# local -R TMP_FILE=$(shell::tmp_file)
shell::tmp_file() {
local -r RESULT=$(mktemp "${TMPDIR}/XXXXXXXX")
- echo "${RESULT}" >> "${VEYRON_SHELL_TMP_FILES}"
+ echo "${RESULT}" >> "${V23_SHELL_TMP_FILES}"
echo "${RESULT}"
}
@@ -170,7 +170,7 @@
"$@" > "${STDOUT}" 2> "${STDERR}" &
fi
local -r SERVER_PID=$!
- echo "${SERVER_PID}" >> "${VEYRON_SHELL_TMP_PIDS}"
+ echo "${SERVER_PID}" >> "${V23_SHELL_TMP_PIDS}"
echo "${SERVER_PID}"
for i in $(seq 1 "${TIMEOUT}"); do
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 45e366d..2991672 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -70,8 +70,8 @@
uninstallerCmd = "uninstaller"
testFlagName = "random_test_flag"
- // VEYRON prefix is necessary to pass the env filtering.
- testEnvVarName = "VEYRON_RANDOM_ENV_VALUE"
+ // V23 prefix is necessary to pass the env filtering.
+ testEnvVarName = "V23_RANDOM_ENV_VALUE"
redirectEnv = "DEVICE_MANAGER_DONT_REDIRECT_STDOUT_STDERR"
@@ -88,7 +88,7 @@
func TestMain(m *testing.M) {
test.Init()
- isSuidHelper := len(os.Getenv("VEYRON_SUIDHELPER_TEST")) > 0
+ isSuidHelper := len(os.Getenv("V23_SUIDHELPER_TEST")) > 0
if modules.IsModulesChildProcess() && !isSuidHelper {
if err := modules.Dispatch(); err != nil {
fmt.Fprintf(os.Stderr, "modules.Dispatch failed: %v\n", err)
@@ -102,7 +102,7 @@
// TestSuidHelper is testing boilerplate for suidhelper that does not
// create a runtime because the suidhelper is not a Vanadium application.
func TestSuidHelper(t *testing.T) {
- if os.Getenv("VEYRON_SUIDHELPER_TEST") != "1" {
+ if os.Getenv("V23_SUIDHELPER_TEST") != "1" {
return
}
vlog.VI(1).Infof("TestSuidHelper starting")
diff --git a/services/mgmt/device/impl/util_test.go b/services/mgmt/device/impl/util_test.go
index 6eec044..7e0614c 100644
--- a/services/mgmt/device/impl/util_test.go
+++ b/services/mgmt/device/impl/util_test.go
@@ -396,7 +396,7 @@
// a suidhelper instance and returns the path to the script.
func generateSuidHelperScript(t *testing.T, root string) string {
output := "#!/bin/bash\n"
- output += "VEYRON_SUIDHELPER_TEST=1"
+ output += "V23_SUIDHELPER_TEST=1"
output += " "
output += "exec " + os.Args[0] + " -minuid=1 -test.run=TestSuidHelper \"$@\""
output += "\n"
diff --git a/services/mgmt/lib/testutil/modules.go b/services/mgmt/lib/testutil/modules.go
index 7b3f6f4..3337061 100644
--- a/services/mgmt/lib/testutil/modules.go
+++ b/services/mgmt/lib/testutil/modules.go
@@ -31,7 +31,7 @@
// removing the generated workspace for successful test runs (for
// failed test runs, this is already the case). This is useful when
// developing test cases.
- preserveWorkspaceEnv = "VEYRON_TEST_PRESERVE_WORKSPACE"
+ preserveWorkspaceEnv = "V23_TEST_PRESERVE_WORKSPACE"
)
func init() {
diff --git a/services/mgmt/suidhelper/impl/args.go b/services/mgmt/suidhelper/impl/args.go
index 58ef83d..f124081 100644
--- a/services/mgmt/suidhelper/impl/args.go
+++ b/services/mgmt/suidhelper/impl/args.go
@@ -75,7 +75,7 @@
func cleanEnv(env []string) []string {
nenv := []string{}
for _, e := range env {
- if !strings.HasPrefix(e, "VEYRON_SUIDHELPER_TEST") {
+ if !strings.HasPrefix(e, "V23_SUIDHELPER_TEST") {
nenv = append(nenv, e)
}
}
@@ -120,7 +120,7 @@
// Preserve the arguments for examination by the test harness if executed
// in the course of a test.
- if os.Getenv("VEYRON_SUIDHELPER_TEST") != "" {
+ if os.Getenv("V23_SUIDHELPER_TEST") != "" {
env = cleanEnv(env)
b := new(bytes.Buffer)
enc := json.NewEncoder(b)