本文整理汇总了Python中bootstrap.Bootstrap.runOsCheckScript方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrap.runOsCheckScript方法的具体用法?Python Bootstrap.runOsCheckScript怎么用?Python Bootstrap.runOsCheckScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.runOsCheckScript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_runOsCheckScript
# 需要导入模块: from bootstrap import Bootstrap [as 别名]
# 或者: from bootstrap.Bootstrap import runOsCheckScript [as 别名]
def test_runOsCheckScript(self, write_mock, run_mock,
init_mock, getOsCheckScriptRemoteLocation_mock):
shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
"setupAgentFile", "ambariServer", "centos6",
None, "8440")
bootstrap_obj = Bootstrap("hostname", shared_state)
getOsCheckScriptRemoteLocation_mock.return_value = "OsCheckScriptRemoteLocation"
expected = 42
init_mock.return_value = None
run_mock.return_value = expected
res = bootstrap_obj.runOsCheckScript()
self.assertEquals(res, expected)
command = str(init_mock.call_args[0][3])
self.assertEqual(command, "chmod a+x OsCheckScriptRemoteLocation &&"
" OsCheckScriptRemoteLocation centos6")