From e049086408a5ad74fd706cb994954ec20d0ae144 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 11 Sep 2025 18:23:06 +0000 Subject: [PATCH 01/28] fix proxy in testing --- .../testing_baremetal/baremetal-testing.yml | 11 +++- .../e2e-ab-update-stage-finalize-test-run.yml | 10 ++-- .../stages/testing_common/e2e-test-run.yml | 12 ++-- e2e_tests/target-configurations.yaml | 56 +++++++++---------- tools/storm/helpers/ab_update.go | 6 +- tools/storm/utils/trident.go | 17 ++++-- 6 files changed, 62 insertions(+), 50 deletions(-) diff --git a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml index 20542d244..90f6ce20a 100644 --- a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml +++ b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml @@ -88,6 +88,10 @@ stages: # Alternate HTTP(S) proxy which can be used with AEP02 is "http://192.168.229.51:3128" - name: BAREMETAL_HTTPS_PROXY value: "http://172.16.1.10:3128" + - name: NO_PROXY_ADDRESSES + value: "${{ variables.BAREMETAL_BMC_IP }},localhost" + - name: BAREMETAL_ENV_VARS + value: "HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }} NO_PROXY=${{ variables.NO_PROXY_ADDRESSES }}" # Sourced from the matrix - name: TRIDENT_CONFIGURATION_NAME @@ -226,14 +230,15 @@ stages: SERVICE_OVERRIDE="" if [ "${{ parameters.runtimeEnv }}" == "host" ]; then SERVICE_OVERRIDE="[Service] - Environment=\"HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}\"" + Environment=\"${{ variables.BAREMETAL_ENV_VARS }}\"" else # When running containerized Trident, we must directly embed the proxy in the docker command SERVICE_OVERRIDE="[Service] - Environment=\"HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}\" + Environment=\"${{ variables.BAREMETAL_ENV_VARS }}\" ExecStart= ExecStart=docker run \\ --env HTTPS_PROXY \\ + --env NO_PROXY \\ --name trident_container \\ --pull=never \\ --rm \\ @@ -391,7 +396,7 @@ stages: netlistenPort: ${{ variables.NETLAUNCH_PORT }} runtimeEnv: ${{ parameters.runtimeEnv }} netlistenConfigFile: $(TRIDENT_SOURCE_DIR)/baremetal-netlisten.yaml - httpsProxy: ${{ variables.BAREMETAL_HTTPS_PROXY }} + envVars: ${{ variables.BAREMETAL_ENV_VARS }} - template: ../common_tasks/remove-from-acr.yml parameters: diff --git a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml index 187beb4f4..3870d0c7b 100644 --- a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml @@ -59,7 +59,7 @@ parameters: type: string default: "" - - name: httpsProxy + - name: envVars type: string default: "" @@ -74,8 +74,8 @@ steps: -s "${{ parameters.artifactsDirectory }}" > ./stage-ab-update-deployment.log 2>&1 & PROXY_ARG="" - if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + if [ -n "${{ parameters.envVars }}" ]; then + PROXY_ARG="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage A/B update..." @@ -142,8 +142,8 @@ steps: -s "${{ parameters.artifactsDirectory }}" > ./finalize-ab-update.log 2>&1 & PROXY_ARG="" - if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + if [ -n "${{ parameters.envVars }}" ]; then + PROXY_ARG="--env-vars ${{ parameters.envVars }}" fi echo "Running script to finalize A/B update..." diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index d6d1ad13b..2af9fabbe 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -59,7 +59,7 @@ parameters: type: string default: "" - - name: httpsProxy + - name: envVars type: string default: "" @@ -133,8 +133,8 @@ steps: -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-B.log 2>&1 & PROXY_ARG="" - if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + if [ -n "${{ parameters.envVars }}" ]; then + PROXY_ARG="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage and finalize A/B update..." @@ -242,8 +242,8 @@ steps: -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-A.log 2>&1 & PROXY_ARG="" - if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + if [ -n "${{ parameters.envVars }}" ]; then + PROXY_ARG="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage and finalize A/B update..." @@ -353,7 +353,7 @@ steps: deploymentEnvironment: ${{ parameters.deploymentEnvironment }} netlistenPort: ${{ parameters.netlistenPort }} netlistenConfigFile: ${{ parameters.netlistenConfigFile }} - httpsProxy: ${{ parameters.httpsProxy }} + envVars: ${{ parameters.envVars }} - template: ../testing_common/trident-rebuild.yml parameters: diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 54ae26ecc..516576868 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap - - memory-constraint-combined + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap + # - memory-constraint-combined - misc - - raid-big - - raid-mirrored - - raid-resync-small - - rerun - - root-verity - - simple - - split - - usr-verity - - usr-verity-raid + # - raid-big + # - raid-mirrored + # - raid-resync-small + # - rerun + # - root-verity + # - simple + # - split + # - usr-verity + # - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap - misc - - raid-mirrored - - raid-resync-small - - raid-small - - rerun - - root-verity - - simple - - usr-verity - - usr-verity-raid + # - raid-mirrored + # - raid-resync-small + # - raid-small + # - rerun + # - root-verity + # - simple + # - usr-verity + # - usr-verity-raid weekly: - base - combined diff --git a/tools/storm/helpers/ab_update.go b/tools/storm/helpers/ab_update.go index b0aadf53e..34ad6bb53 100644 --- a/tools/storm/helpers/ab_update.go +++ b/tools/storm/helpers/ab_update.go @@ -25,7 +25,7 @@ type AbUpdateHelper struct { Version string `short:"v" required:"" help:"Version of the Trident image to use for the A/B update."` StageAbUpdate bool `short:"s" help:"Controls whether A/B update should be staged."` FinalizeAbUpdate bool `short:"f" help:"Controls whether A/B update should be finalized."` - Proxy string `help:"Proxy address. Input should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` + EnvVars string `short:"e" help:"Environment variables separated by spaces. Input should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` } client *ssh.Client @@ -65,7 +65,7 @@ func (h *AbUpdateHelper) getHostConfig(tc storm.TestCase) error { } }) - out, err := utils.InvokeTrident(h.args.Env, h.client, h.args.Proxy, "get configuration") + out, err := utils.InvokeTrident(h.args.Env, h.client, h.args.EnvVars, "get configuration") if err != nil { return fmt.Errorf("failed to invoke Trident: %w", err) } @@ -230,7 +230,7 @@ func (h *AbUpdateHelper) triggerTridentUpdate(tc storm.TestCase) error { for i := 1; ; i++ { logrus.Infof("Invoking Trident attempt #%d with args: %s", i, args) - out, err := utils.InvokeTrident(h.args.Env, h.client, h.args.Proxy, args) + out, err := utils.InvokeTrident(h.args.Env, h.client, h.args.EnvVars, args) if err != nil { if err, ok := err.(*ssh.ExitMissingError); ok && strings.Contains(out.Stderr, "Rebooting system") { // The connection closed without an exit code, and the output contains "Rebooting system". diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index adaf15108..d41ed4946 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -38,13 +38,13 @@ func BuildTridentContainerCommand(env string) string { // - The SSH session cannot be created // - There was an error starting the command. // - Some IO error occurred while reading stdout or stderr. -func InvokeTrident(env TridentEnvironment, client *ssh.Client, proxy string, arguments string) (*SshCmdOutput, error) { +func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars string, arguments string) (*SshCmdOutput, error) { var cmd string switch env { case TridentEnvironmentHost: cmd = TRIDENT_BINARY case TridentEnvironmentContainer: - cmd = BuildTridentContainerCommand(proxy) + cmd = BuildTridentContainerCommand(envVars) case TridentEnvironmentNone: return nil, fmt.Errorf("trident service is not running") default: @@ -52,9 +52,16 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, proxy string, arg } var cmdPrefix string - if proxy != "" { - envVar := strings.Split(proxy, "=")[0] - cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", proxy, envVar) + if envVars != "" { + vars := strings.Split(envVars, " ") + var envKeys []string + for _, v := range vars { + if key := strings.Split(v, "=")[0]; key != "" { + envKeys = append(envKeys, key) + } + } + preservedEnvs := strings.Join(envKeys, ",") + cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", envVars, preservedEnvs) } else { cmdPrefix = "sudo" } From df6b1312296fb07927db5f151fb49d0eac06dccf Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 11 Sep 2025 19:06:35 +0000 Subject: [PATCH 02/28] no noproxy --- .../templates/stages/testing_baremetal/baremetal-testing.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml index 90f6ce20a..c0f837a35 100644 --- a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml +++ b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml @@ -88,10 +88,8 @@ stages: # Alternate HTTP(S) proxy which can be used with AEP02 is "http://192.168.229.51:3128" - name: BAREMETAL_HTTPS_PROXY value: "http://172.16.1.10:3128" - - name: NO_PROXY_ADDRESSES - value: "${{ variables.BAREMETAL_BMC_IP }},localhost" - name: BAREMETAL_ENV_VARS - value: "HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }} NO_PROXY=${{ variables.NO_PROXY_ADDRESSES }}" + value: "HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}" # Sourced from the matrix - name: TRIDENT_CONFIGURATION_NAME From 75411adc974b99f37834d6ac91b1b4b1fec778e5 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 11 Sep 2025 20:26:12 +0000 Subject: [PATCH 03/28] revert target config --- e2e_tests/target-configurations.yaml | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 516576868..54ae26ecc 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap - # - memory-constraint-combined + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap + - memory-constraint-combined - misc - # - raid-big - # - raid-mirrored - # - raid-resync-small - # - rerun - # - root-verity - # - simple - # - split - # - usr-verity - # - usr-verity-raid + - raid-big + - raid-mirrored + - raid-resync-small + - rerun + - root-verity + - simple + - split + - usr-verity + - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap - misc - # - raid-mirrored - # - raid-resync-small - # - raid-small - # - rerun - # - root-verity - # - simple - # - usr-verity - # - usr-verity-raid + - raid-mirrored + - raid-resync-small + - raid-small + - rerun + - root-verity + - simple + - usr-verity + - usr-verity-raid weekly: - base - combined From d10c8f82470f7cbf3426abb29f9135e4b6f10209 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 00:21:22 +0000 Subject: [PATCH 04/28] remove noproxy --- .../templates/stages/testing_baremetal/baremetal-testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml index c0f837a35..e4c32cce2 100644 --- a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml +++ b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml @@ -236,7 +236,6 @@ stages: ExecStart= ExecStart=docker run \\ --env HTTPS_PROXY \\ - --env NO_PROXY \\ --name trident_container \\ --pull=never \\ --rm \\ From 7e2c325e2b49bbbb17ecdb42a7f2330935a91d32 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 00:36:19 +0000 Subject: [PATCH 05/28] try as array of strings --- tools/storm/helpers/ab_update.go | 10 +++++----- tools/storm/utils/trident.go | 15 +++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/storm/helpers/ab_update.go b/tools/storm/helpers/ab_update.go index 34ad6bb53..b84ac6f99 100644 --- a/tools/storm/helpers/ab_update.go +++ b/tools/storm/helpers/ab_update.go @@ -21,11 +21,11 @@ type AbUpdateHelper struct { args struct { utils.SshCliSettings `embed:""` utils.EnvCliSettings `embed:""` - TridentConfig string `short:"c" required:"" help:"File name of the custom read-write Trident config on the host to point Trident to."` - Version string `short:"v" required:"" help:"Version of the Trident image to use for the A/B update."` - StageAbUpdate bool `short:"s" help:"Controls whether A/B update should be staged."` - FinalizeAbUpdate bool `short:"f" help:"Controls whether A/B update should be finalized."` - EnvVars string `short:"e" help:"Environment variables separated by spaces. Input should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` + TridentConfig string `short:"c" required:"" help:"File name of the custom read-write Trident config on the host to point Trident to."` + Version string `short:"v" required:"" help:"Version of the Trident image to use for the A/B update."` + StageAbUpdate bool `short:"s" help:"Controls whether A/B update should be staged."` + FinalizeAbUpdate bool `short:"f" help:"Controls whether A/B update should be finalized."` + EnvVars []string `short:"e" help:"Environment variables, as a list of strings. Each var should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` } client *ssh.Client diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index d41ed4946..f65efa2db 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -19,10 +19,10 @@ const ( DOCKER_IMAGE_PATH = "/var/lib/trident/trident-container.tar.gz" ) -func BuildTridentContainerCommand(env string) string { +func BuildTridentContainerCommand(envVars []string) string { cmd := DOCKER_COMMAND_BASE - if env != "" { - cmd += fmt.Sprintf("--env %s ", env) + if len(envVars) != 0 { + cmd += fmt.Sprintf("--env %s ", strings.Join(envVars, " ")) } cmd += TRIDENT_CONTAINER return cmd @@ -38,7 +38,7 @@ func BuildTridentContainerCommand(env string) string { // - The SSH session cannot be created // - There was an error starting the command. // - Some IO error occurred while reading stdout or stderr. -func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars string, arguments string) (*SshCmdOutput, error) { +func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, arguments string) (*SshCmdOutput, error) { var cmd string switch env { case TridentEnvironmentHost: @@ -52,16 +52,15 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars string, a } var cmdPrefix string - if envVars != "" { - vars := strings.Split(envVars, " ") + if len(envVars) != 0 { var envKeys []string - for _, v := range vars { + for _, v := range envVars { if key := strings.Split(v, "=")[0]; key != "" { envKeys = append(envKeys, key) } } preservedEnvs := strings.Join(envKeys, ",") - cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", envVars, preservedEnvs) + cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", strings.Join(envVars, " "), preservedEnvs) } else { cmdPrefix = "sudo" } From 0a11b46b37ccb32bbf3912d1a4cda6dfcc385db7 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 15:44:25 +0000 Subject: [PATCH 06/28] test only misc --- e2e_tests/target-configurations.yaml | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 54ae26ecc..516576868 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap - - memory-constraint-combined + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap + # - memory-constraint-combined - misc - - raid-big - - raid-mirrored - - raid-resync-small - - rerun - - root-verity - - simple - - split - - usr-verity - - usr-verity-raid + # - raid-big + # - raid-mirrored + # - raid-resync-small + # - rerun + # - root-verity + # - simple + # - split + # - usr-verity + # - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap - misc - - raid-mirrored - - raid-resync-small - - raid-small - - rerun - - root-verity - - simple - - usr-verity - - usr-verity-raid + # - raid-mirrored + # - raid-resync-small + # - raid-small + # - rerun + # - root-verity + # - simple + # - usr-verity + # - usr-verity-raid weekly: - base - combined From c55cc0aada7057b3235e7fb3eac2f8980a726f22 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 17:35:01 +0000 Subject: [PATCH 07/28] revert target configs --- e2e_tests/target-configurations.yaml | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 516576868..54ae26ecc 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap - # - memory-constraint-combined + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap + - memory-constraint-combined - misc - # - raid-big - # - raid-mirrored - # - raid-resync-small - # - rerun - # - root-verity - # - simple - # - split - # - usr-verity - # - usr-verity-raid + - raid-big + - raid-mirrored + - raid-resync-small + - rerun + - root-verity + - simple + - split + - usr-verity + - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap - misc - # - raid-mirrored - # - raid-resync-small - # - raid-small - # - rerun - # - root-verity - # - simple - # - usr-verity - # - usr-verity-raid + - raid-mirrored + - raid-resync-small + - raid-small + - rerun + - root-verity + - simple + - usr-verity + - usr-verity-raid weekly: - base - combined From 41fa1345186dc073c5ffffcca25c33535a0d6103 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 21:55:52 +0000 Subject: [PATCH 08/28] change variable name to env_var_args --- .../e2e-ab-update-stage-finalize-test-run.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml index 3870d0c7b..9fa5e5534 100644 --- a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml @@ -73,9 +73,9 @@ steps: -p ${{ parameters.netlistenPort }} \ -s "${{ parameters.artifactsDirectory }}" > ./stage-ab-update-deployment.log 2>&1 & - PROXY_ARG="" + ENV_VAR_ARGS="" if [ -n "${{ parameters.envVars }}" ]; then - PROXY_ARG="--env-vars ${{ parameters.envVars }}" + ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage A/B update..." @@ -87,7 +87,7 @@ steps: --trident-config $(tridentConfigFile) \ --version $(version) \ --stage-ab-update \ - $PROXY_ARG + $ENV_VAR_ARGS timeoutInMinutes: 5 workingDirectory: $(Build.SourcesDirectory) displayName: "🔄 Stage A/B update" @@ -141,9 +141,9 @@ steps: -p ${{ parameters.netlistenPort }} \ -s "${{ parameters.artifactsDirectory }}" > ./finalize-ab-update.log 2>&1 & - PROXY_ARG="" + ENV_VARS_ARG="" if [ -n "${{ parameters.envVars }}" ]; then - PROXY_ARG="--env-vars ${{ parameters.envVars }}" + ENV_VARS_ARG="--env-vars ${{ parameters.envVars }}" fi echo "Running script to finalize A/B update..." @@ -155,7 +155,7 @@ steps: --trident-config $(tridentConfigFile) \ --version $(version) \ --finalize-ab-update \ - $PROXY_ARG + $ENV_VARS_ARG # Un-set the 'x' flag to avoid errors. set +x From cf07c74622d1e2711299a13745c5ae58eda805bb Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 12 Sep 2025 22:00:31 +0000 Subject: [PATCH 09/28] rename to env-var-args in e2e-test-run --- .../templates/stages/testing_common/e2e-test-run.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index 2af9fabbe..1ee01e6cb 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -132,9 +132,9 @@ steps: -s "${{ parameters.artifactsDirectory }}" \ -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-B.log 2>&1 & - PROXY_ARG="" + ENV_VAR_ARGS="" if [ -n "${{ parameters.envVars }}" ]; then - PROXY_ARG="--env-vars ${{ parameters.envVars }}" + ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage and finalize A/B update..." @@ -147,7 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - $PROXY_ARG + $ENV_VAR_ARGS current_version=$(echo $(version)) new_version=$((current_version + 1)) @@ -241,9 +241,9 @@ steps: -s "${{ parameters.artifactsDirectory }}" \ -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-A.log 2>&1 & - PROXY_ARG="" + ENV_VAR_ARGS="" if [ -n "${{ parameters.envVars }}" ]; then - PROXY_ARG="--env-vars ${{ parameters.envVars }}" + ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" fi echo "Running script to stage and finalize A/B update..." @@ -256,7 +256,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - $PROXY_ARG + $ENV_VAR_ARGS current_version=$(echo $(version)) new_version=$((current_version + 1)) From 73143fe0ad5269b492df710dff308a4a957ccaaf Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 21:04:12 +0000 Subject: [PATCH 10/28] go back to https proxy --- .../stages/testing_baremetal/baremetal-testing.yml | 8 +++----- .../e2e-ab-update-stage-finalize-test-run.yml | 10 +++++----- .../templates/stages/testing_common/e2e-test-run.yml | 12 ++++++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml index e4c32cce2..20542d244 100644 --- a/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml +++ b/.pipelines/templates/stages/testing_baremetal/baremetal-testing.yml @@ -88,8 +88,6 @@ stages: # Alternate HTTP(S) proxy which can be used with AEP02 is "http://192.168.229.51:3128" - name: BAREMETAL_HTTPS_PROXY value: "http://172.16.1.10:3128" - - name: BAREMETAL_ENV_VARS - value: "HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}" # Sourced from the matrix - name: TRIDENT_CONFIGURATION_NAME @@ -228,11 +226,11 @@ stages: SERVICE_OVERRIDE="" if [ "${{ parameters.runtimeEnv }}" == "host" ]; then SERVICE_OVERRIDE="[Service] - Environment=\"${{ variables.BAREMETAL_ENV_VARS }}\"" + Environment=\"HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}\"" else # When running containerized Trident, we must directly embed the proxy in the docker command SERVICE_OVERRIDE="[Service] - Environment=\"${{ variables.BAREMETAL_ENV_VARS }}\" + Environment=\"HTTPS_PROXY=${{ variables.BAREMETAL_HTTPS_PROXY }}\" ExecStart= ExecStart=docker run \\ --env HTTPS_PROXY \\ @@ -393,7 +391,7 @@ stages: netlistenPort: ${{ variables.NETLAUNCH_PORT }} runtimeEnv: ${{ parameters.runtimeEnv }} netlistenConfigFile: $(TRIDENT_SOURCE_DIR)/baremetal-netlisten.yaml - envVars: ${{ variables.BAREMETAL_ENV_VARS }} + httpsProxy: ${{ variables.BAREMETAL_HTTPS_PROXY }} - template: ../common_tasks/remove-from-acr.yml parameters: diff --git a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml index 9fa5e5534..de28152ca 100644 --- a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml @@ -59,7 +59,7 @@ parameters: type: string default: "" - - name: envVars + - name: httpsProxy type: string default: "" @@ -74,8 +74,8 @@ steps: -s "${{ parameters.artifactsDirectory }}" > ./stage-ab-update-deployment.log 2>&1 & ENV_VAR_ARGS="" - if [ -n "${{ parameters.envVars }}" ]; then - ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" + if [ -n "${{ parameters.httpsProxy }}" ]; then + ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage A/B update..." @@ -142,8 +142,8 @@ steps: -s "${{ parameters.artifactsDirectory }}" > ./finalize-ab-update.log 2>&1 & ENV_VARS_ARG="" - if [ -n "${{ parameters.envVars }}" ]; then - ENV_VARS_ARG="--env-vars ${{ parameters.envVars }}" + if [ -n "${{ parameters.httpsProxy }}" ]; then + ENV_VARS_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to finalize A/B update..." diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index 1ee01e6cb..cb2c46e33 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -59,7 +59,7 @@ parameters: type: string default: "" - - name: envVars + - name: httpsProxy type: string default: "" @@ -133,8 +133,8 @@ steps: -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-B.log 2>&1 & ENV_VAR_ARGS="" - if [ -n "${{ parameters.envVars }}" ]; then - ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" + if [ -n "${{ parameters.httpsProxy }}" ]; then + ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -242,8 +242,8 @@ steps: -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-A.log 2>&1 & ENV_VAR_ARGS="" - if [ -n "${{ parameters.envVars }}" ]; then - ENV_VAR_ARGS="--env-vars ${{ parameters.envVars }}" + if [ -n "${{ parameters.httpsProxy }}" ]; then + ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -353,7 +353,7 @@ steps: deploymentEnvironment: ${{ parameters.deploymentEnvironment }} netlistenPort: ${{ parameters.netlistenPort }} netlistenConfigFile: ${{ parameters.netlistenConfigFile }} - envVars: ${{ parameters.envVars }} + httpsProxy: ${{ parameters.httpsProxy }} - template: ../testing_common/trident-rebuild.yml parameters: From 12c51939ecb4662aab723825900831d4ef7d0e98 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 21:23:16 +0000 Subject: [PATCH 11/28] rename ot PROXYARG --- .../e2e-ab-update-stage-finalize-test-run.yml | 6 +++--- .../templates/stages/testing_common/e2e-test-run.yml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml index de28152ca..3a9a9e59a 100644 --- a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml @@ -141,9 +141,9 @@ steps: -p ${{ parameters.netlistenPort }} \ -s "${{ parameters.artifactsDirectory }}" > ./finalize-ab-update.log 2>&1 & - ENV_VARS_ARG="" + PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - ENV_VARS_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to finalize A/B update..." @@ -155,7 +155,7 @@ steps: --trident-config $(tridentConfigFile) \ --version $(version) \ --finalize-ab-update \ - $ENV_VARS_ARG + $PROXY_ARG # Un-set the 'x' flag to avoid errors. set +x diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index cb2c46e33..a932174fa 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -132,9 +132,9 @@ steps: -s "${{ parameters.artifactsDirectory }}" \ -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-B.log 2>&1 & - ENV_VAR_ARGS="" + PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -147,7 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - $ENV_VAR_ARGS + $PROXY_ARG current_version=$(echo $(version)) new_version=$((current_version + 1)) @@ -241,9 +241,9 @@ steps: -s "${{ parameters.artifactsDirectory }}" \ -p ${{ parameters.netlistenPort }} > ./stage-finalize-ab-update-runtime-os-A.log 2>&1 & - ENV_VAR_ARGS="" + PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -256,7 +256,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - $ENV_VAR_ARGS + $PROXY_ARG current_version=$(echo $(version)) new_version=$((current_version + 1)) From 1de9f148f87e830cf93b48a557d15413a39795bd Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 21:24:16 +0000 Subject: [PATCH 12/28] rename contd --- .../e2e-ab-update-stage-finalize-test-run.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml index 3a9a9e59a..73f86bc00 100644 --- a/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-ab-update-stage-finalize-test-run.yml @@ -73,9 +73,9 @@ steps: -p ${{ parameters.netlistenPort }} \ -s "${{ parameters.artifactsDirectory }}" > ./stage-ab-update-deployment.log 2>&1 & - ENV_VAR_ARGS="" + PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - ENV_VAR_ARGS="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage A/B update..." @@ -87,7 +87,7 @@ steps: --trident-config $(tridentConfigFile) \ --version $(version) \ --stage-ab-update \ - $ENV_VAR_ARGS + $PROXY_ARG timeoutInMinutes: 5 workingDirectory: $(Build.SourcesDirectory) displayName: "🔄 Stage A/B update" From f1ce724307f78d0ef6875de053f4bb9104d85b4c Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 22:04:13 +0000 Subject: [PATCH 13/28] add test env vars --- .pipelines/templates/stages/testing_common/e2e-test-run.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index a932174fa..ba120c621 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -147,7 +147,8 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - $PROXY_ARG + --env-vars TEST_ONE="testvalue", TEST_TWO="testvalue2" + --env-vars TEST_THREE="testvalue3" current_version=$(echo $(version)) new_version=$((current_version + 1)) From 6fe7aa92a176726badb418991c1b5b42653c2e33 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 22:26:41 +0000 Subject: [PATCH 14/28] add log --- .pipelines/templates/stages/testing_common/e2e-test-run.yml | 2 +- tools/storm/utils/trident.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index ba120c621..b1dd24c39 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -147,7 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - --env-vars TEST_ONE="testvalue", TEST_TWO="testvalue2" + --env-vars TEST_ONE="testvalue",TEST_TWO="testvalue2" --env-vars TEST_THREE="testvalue3" current_version=$(echo $(version)) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index f65efa2db..dae1eaa77 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -65,6 +65,8 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, cmdPrefix = "sudo" } + logrus.Debugf("Command prefix is: %s", cmdPrefix) + logrus.Debug(fmt.Sprintf("Running command: %s %s %s", cmdPrefix, cmd, arguments)) return RunCommand(client, fmt.Sprintf("%s %s %s", cmdPrefix, cmd, arguments)) } From e4107746d4ae047a75ebe15a5925376d25767910 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 22:56:53 +0000 Subject: [PATCH 15/28] add --env for each var --- tools/storm/utils/trident.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index dae1eaa77..6b0ee6e60 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -22,7 +22,9 @@ const ( func BuildTridentContainerCommand(envVars []string) string { cmd := DOCKER_COMMAND_BASE if len(envVars) != 0 { - cmd += fmt.Sprintf("--env %s ", strings.Join(envVars, " ")) + for _, envVar := range envVars { + cmd += fmt.Sprintf("--env %s ", envVar) + } } cmd += TRIDENT_CONTAINER return cmd From 5c92b73ecc0354aff0fc127e15d8e78d3b9cec06 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:19:16 +0000 Subject: [PATCH 16/28] test again --- .pipelines/templates/stages/testing_common/e2e-test-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index b1dd24c39..3e6392820 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -147,7 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - --env-vars TEST_ONE="testvalue",TEST_TWO="testvalue2" + --env-vars TEST_ONE="testvalue" --env-vars TEST_THREE="testvalue3" current_version=$(echo $(version)) From 910492f428d3973ad0f08c36f99bd0bac6c3f5ef Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:21:43 +0000 Subject: [PATCH 17/28] fixed typo --- .pipelines/templates/stages/testing_common/e2e-test-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index 3e6392820..c5b44fe39 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -147,7 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - --env-vars TEST_ONE="testvalue" + --env-vars TEST_ONE="testvalue",TEST_TWO="testvalue2" \ --env-vars TEST_THREE="testvalue3" current_version=$(echo $(version)) From faf8e97e63b734f87d6dab584347edab82f1d1e7 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:44:11 +0000 Subject: [PATCH 18/28] revert test env vars --- .../templates/stages/testing_common/e2e-test-run.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index c5b44fe39..d6d1ad13b 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -134,7 +134,7 @@ steps: PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -147,8 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - --env-vars TEST_ONE="testvalue",TEST_TWO="testvalue2" \ - --env-vars TEST_THREE="testvalue3" + $PROXY_ARG current_version=$(echo $(version)) new_version=$((current_version + 1)) @@ -244,7 +243,7 @@ steps: PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." From c644cdb7a3dbc67d33924b442424cbaaf482f069 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:46:42 +0000 Subject: [PATCH 19/28] update help string --- tools/storm/helpers/ab_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/storm/helpers/ab_update.go b/tools/storm/helpers/ab_update.go index b84ac6f99..ae09a835c 100644 --- a/tools/storm/helpers/ab_update.go +++ b/tools/storm/helpers/ab_update.go @@ -25,7 +25,7 @@ type AbUpdateHelper struct { Version string `short:"v" required:"" help:"Version of the Trident image to use for the A/B update."` StageAbUpdate bool `short:"s" help:"Controls whether A/B update should be staged."` FinalizeAbUpdate bool `short:"f" help:"Controls whether A/B update should be finalized."` - EnvVars []string `short:"e" help:"Environment variables, as a list of strings. Each var should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` + EnvVars []string `short:"e" help:"Environment variables. Multiple env vars can be passed as a list of comma-separated strings, or this flag can be used multiple times. Each var should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` } client *ssh.Client From e66110de71cc54dfe2bb5d4615e92a3ebacf176c Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:47:19 +0000 Subject: [PATCH 20/28] nit --- tools/storm/helpers/ab_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/storm/helpers/ab_update.go b/tools/storm/helpers/ab_update.go index ae09a835c..fc098cf2c 100644 --- a/tools/storm/helpers/ab_update.go +++ b/tools/storm/helpers/ab_update.go @@ -25,7 +25,7 @@ type AbUpdateHelper struct { Version string `short:"v" required:"" help:"Version of the Trident image to use for the A/B update."` StageAbUpdate bool `short:"s" help:"Controls whether A/B update should be staged."` FinalizeAbUpdate bool `short:"f" help:"Controls whether A/B update should be finalized."` - EnvVars []string `short:"e" help:"Environment variables. Multiple env vars can be passed as a list of comma-separated strings, or this flag can be used multiple times. Each var should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` + EnvVars []string `short:"e" help:"Environment variables. Multiple vars can be passed as a list of comma-separated strings, or this flag can be used multiple times. Each var should include the env var name, i.e. HTTPS_PROXY=http://0.0.0.0."` } client *ssh.Client From e3b8a44693810aa71b1a3dbfe23f9844ad6c4a96 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:51:43 +0000 Subject: [PATCH 21/28] use strings cut --- tools/storm/utils/trident.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index 6b0ee6e60..f5cd1916d 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -57,7 +57,7 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, if len(envVars) != 0 { var envKeys []string for _, v := range envVars { - if key := strings.Split(v, "=")[0]; key != "" { + if key, _, _ := strings.Cut(v, "="); key != "" { envKeys = append(envKeys, key) } } From 6b28ac2d8f552160e9d82fe2e3f2eadb0117306b Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Thu, 18 Sep 2025 23:52:21 +0000 Subject: [PATCH 22/28] remove unnecessary log --- tools/storm/utils/trident.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index f5cd1916d..b820ddc61 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -67,8 +67,6 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, cmdPrefix = "sudo" } - logrus.Debugf("Command prefix is: %s", cmdPrefix) - logrus.Debug(fmt.Sprintf("Running command: %s %s %s", cmdPrefix, cmd, arguments)) return RunCommand(client, fmt.Sprintf("%s %s %s", cmdPrefix, cmd, arguments)) } From 13389751adda57e694475f777312426bbb2254bb Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 00:01:27 +0000 Subject: [PATCH 23/28] use single quotes --- tools/storm/utils/trident.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index b820ddc61..db4ae56e1 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -23,7 +23,7 @@ func BuildTridentContainerCommand(envVars []string) string { cmd := DOCKER_COMMAND_BASE if len(envVars) != 0 { for _, envVar := range envVars { - cmd += fmt.Sprintf("--env %s ", envVar) + cmd += fmt.Sprintf("--env '%s' ", envVar) } } cmd += TRIDENT_CONTAINER @@ -61,8 +61,12 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, envKeys = append(envKeys, key) } } + var quotedEnvVars []string + for _, v := range envVars { + quotedEnvVars = append(quotedEnvVars, fmt.Sprintf("'%s'", v)) + } preservedEnvs := strings.Join(envKeys, ",") - cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", strings.Join(envVars, " "), preservedEnvs) + cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", strings.Join(quotedEnvVars, " "), preservedEnvs) } else { cmdPrefix = "sudo" } From 34282b8e880c19ecc67cdf3f887ef0549104694f Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 00:07:42 +0000 Subject: [PATCH 24/28] preserve env unnecessary --- .../stages/testing_common/e2e-test-run.yml | 5 +++-- tools/storm/utils/trident.go | 20 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index d6d1ad13b..622d380c8 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -134,7 +134,7 @@ steps: PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." @@ -147,6 +147,7 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ + --env-vars TEST_ONE="test one",TEST_TWO="testtwo" \ $PROXY_ARG current_version=$(echo $(version)) @@ -243,7 +244,7 @@ steps: PROXY_ARG="" if [ -n "${{ parameters.httpsProxy }}" ]; then - PROXY_ARG="--proxy HTTPS_PROXY=${{ parameters.httpsProxy }}" + PROXY_ARG="--env-vars HTTPS_PROXY=${{ parameters.httpsProxy }}" fi echo "Running script to stage and finalize A/B update..." diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index db4ae56e1..e923679c1 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -55,18 +55,18 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, var cmdPrefix string if len(envVars) != 0 { - var envKeys []string + // var envKeys []string + // for _, v := range envVars { + // if key, _, _ := strings.Cut(v, "="); key != "" { + // envKeys = append(envKeys, key) + // } + // } + var quotedEnvVars = "" for _, v := range envVars { - if key, _, _ := strings.Cut(v, "="); key != "" { - envKeys = append(envKeys, key) - } - } - var quotedEnvVars []string - for _, v := range envVars { - quotedEnvVars = append(quotedEnvVars, fmt.Sprintf("'%s'", v)) + quotedEnvVars += fmt.Sprintf("'%s' ", v) } - preservedEnvs := strings.Join(envKeys, ",") - cmdPrefix = fmt.Sprintf("%s sudo --preserve-env=%s", strings.Join(quotedEnvVars, " "), preservedEnvs) + // preservedEnvs := strings.Join(envKeys, ",") + cmdPrefix = fmt.Sprintf("sudo %s", quotedEnvVars) } else { cmdPrefix = "sudo" } From b5db98f4a22f6843661c0c04331e3e0398930cbc Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 00:13:28 +0000 Subject: [PATCH 25/28] only run misc for validation --- e2e_tests/target-configurations.yaml | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 54ae26ecc..516576868 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap - - memory-constraint-combined + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap + # - memory-constraint-combined - misc - - raid-big - - raid-mirrored - - raid-resync-small - - rerun - - root-verity - - simple - - split - - usr-verity - - usr-verity-raid + # - raid-big + # - raid-mirrored + # - raid-resync-small + # - rerun + # - root-verity + # - simple + # - split + # - usr-verity + # - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - - base - - combined - - encrypted-partition - - encrypted-raid - - encrypted-swap + # - base + # - combined + # - encrypted-partition + # - encrypted-raid + # - encrypted-swap - misc - - raid-mirrored - - raid-resync-small - - raid-small - - rerun - - root-verity - - simple - - usr-verity - - usr-verity-raid + # - raid-mirrored + # - raid-resync-small + # - raid-small + # - rerun + # - root-verity + # - simple + # - usr-verity + # - usr-verity-raid weekly: - base - combined From 36eb1d35c4ab41bf6744a507f671999d3d894426 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 16:33:18 +0000 Subject: [PATCH 26/28] revert target config --- e2e_tests/target-configurations.yaml | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/e2e_tests/target-configurations.yaml b/e2e_tests/target-configurations.yaml index 516576868..54ae26ecc 100644 --- a/e2e_tests/target-configurations.yaml +++ b/e2e_tests/target-configurations.yaml @@ -7,22 +7,22 @@ bareMetal: - split - usr-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap - # - memory-constraint-combined + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap + - memory-constraint-combined - misc - # - raid-big - # - raid-mirrored - # - raid-resync-small - # - rerun - # - root-verity - # - simple - # - split - # - usr-verity - # - usr-verity-raid + - raid-big + - raid-mirrored + - raid-resync-small + - rerun + - root-verity + - simple + - split + - usr-verity + - usr-verity-raid weekly: - base - combined @@ -50,20 +50,20 @@ bareMetal: - rerun - root-verity validation: - # - base - # - combined - # - encrypted-partition - # - encrypted-raid - # - encrypted-swap + - base + - combined + - encrypted-partition + - encrypted-raid + - encrypted-swap - misc - # - raid-mirrored - # - raid-resync-small - # - raid-small - # - rerun - # - root-verity - # - simple - # - usr-verity - # - usr-verity-raid + - raid-mirrored + - raid-resync-small + - raid-small + - rerun + - root-verity + - simple + - usr-verity + - usr-verity-raid weekly: - base - combined From f0e8bbe9309e2904928baa278616b21fe8f87778 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 16:34:22 +0000 Subject: [PATCH 27/28] remove test env var --- .pipelines/templates/stages/testing_common/e2e-test-run.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/templates/stages/testing_common/e2e-test-run.yml b/.pipelines/templates/stages/testing_common/e2e-test-run.yml index 622d380c8..a932174fa 100644 --- a/.pipelines/templates/stages/testing_common/e2e-test-run.yml +++ b/.pipelines/templates/stages/testing_common/e2e-test-run.yml @@ -147,7 +147,6 @@ steps: --version $(version) \ --stage-ab-update \ --finalize-ab-update \ - --env-vars TEST_ONE="test one",TEST_TWO="testtwo" \ $PROXY_ARG current_version=$(echo $(version)) From 0fb3f2d7458feb3dadc94ff360bc91b17cf1e712 Mon Sep 17 00:00:00 2001 From: Ayana Yaegashi Date: Fri, 19 Sep 2025 16:35:52 +0000 Subject: [PATCH 28/28] remove code declaring vars before sudo --- tools/storm/utils/trident.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/storm/utils/trident.go b/tools/storm/utils/trident.go index e923679c1..06e7f6e96 100644 --- a/tools/storm/utils/trident.go +++ b/tools/storm/utils/trident.go @@ -55,17 +55,10 @@ func InvokeTrident(env TridentEnvironment, client *ssh.Client, envVars []string, var cmdPrefix string if len(envVars) != 0 { - // var envKeys []string - // for _, v := range envVars { - // if key, _, _ := strings.Cut(v, "="); key != "" { - // envKeys = append(envKeys, key) - // } - // } var quotedEnvVars = "" for _, v := range envVars { quotedEnvVars += fmt.Sprintf("'%s' ", v) } - // preservedEnvs := strings.Join(envKeys, ",") cmdPrefix = fmt.Sprintf("sudo %s", quotedEnvVars) } else { cmdPrefix = "sudo"