Commit f63b109f authored by Lisa Velden's avatar Lisa Velden

Add QA test for secret parameter transmission

This test is done with the newly introduced opcode 'gnt-debug
test-osparams'. Redaction of secret parameters within the job file is
also tested again with this opcode.
Signed-off-by: default avatarLisa Velden <>
Reviewed-by: default avatarHrvoje Ribicic <>
parent 61dec056
......@@ -1065,6 +1065,7 @@ def RunQa():
RunTestIf("instance-add-osparams", qa_instance.TestInstanceAddOsParams)
RunTestIf("instance-add-osparams", qa_instance.TestSecretOsParams)
# Test removing instance with offline drbd secondary
if qa_config.TestEnabled(["instance-remove-drbd-offline",
......@@ -1565,6 +1565,21 @@ def TestInstanceAddOsParams():
def TestSecretOsParams():
"""Tests secret os parameter transmission"""
secret_keys = ["param1", "param2"]
cmd = (["gnt-debug", "test-osparams", "--os-parameters-secret",
"param1=secret1,param2=secret2", "--submit", "--print-jobid"])
_TestRedactionOfSecretOsParams(cmd, secret_keys)
cmd_output = stdout_of(["gnt-debug", "test-osparams",
AssertIn("\'param1\': \'secret1\'", cmd_output)
AssertIn("\'param2\': \'secret2\'", cmd_output)
available_instance_tests = [
("instance-add-plain-disk", constants.DT_PLAIN,
TestInstanceAddWithPlainDisk, 1),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment