return 0
+def TestOsParams(opts, _):
+ """Set secret os parameters.
+
+ """
+ op = opcodes.OpTestOsParams(osparams_secret=opts.osparams_secret)
+ SubmitOrSend(op, opts)
+
+ return 0
+
+
def ListLocks(opts, args): # pylint: disable=W0613
"""List all locks.
"test-jobqueue": (
TestJobqueue, ARGS_NONE, [PRIORITY_OPT],
"", "Test a few aspects of the job queue"),
+ "test-osparams": (
+ TestOsParams, ARGS_NONE, [OSPARAMS_SECRET_OPT] + SUBMIT_OPTS,
+ "[--os-parameters-secret <params>]",
+ "Test secret os parameter transmission"),
"locks": (
ListLocks, ARGS_NONE,
[NOHDR_OPT, SEP_OPT, FIELDS_OPT, INTERVAL_OPT, VERBOSE_OPT],
return True
+class LUTestOsParams(NoHooksLU):
+ """Utility LU to test secret OS parameter transmission.
+
+ """
+ REQ_BGL = False
+
+ def ExpandNames(self):
+ self.needed_locks = {}
+
+ def Exec(self, feedback_fn):
+ if self.op.osparams_secret:
+ msg = "Secret OS parameters: %s" % self.op.osparams_secret.Unprivate()
+ feedback_fn(msg)
+ else:
+ raise errors.OpExecError("Opcode needs secret parameters")
+
+
class LUTestAllocator(NoHooksLU):
"""Run allocator tests.
Executes a few tests on the job queue. This command might generate
failed jobs deliberately.
+TEST_OSPARAMS
+~~~~~~~~~~~~~
+
+**test-osparams** {--os-parameters-secret *param*=*value*... }
+
+Tests secret os parameter transmission.
+
LOCKS
~~~~~
opTestJqueue =
"Utility opcode to test some aspects of the job queue."
+opTestOsParams :: String
+opTestOsParams =
+ "Utility opcode to test secret os parameter transmission."
+
opTestDummy :: String
opTestDummy =
"Utility opcode used by unittests."