コード例 #1
0
ファイル: context_test.go プロジェクト: kapilt/juju
func (s *WindowsHookSuite) TestHookCommandNotPowerShellScripts(c *gc.C) {
	restorer := envtesting.PatchValue(&version.Current.OS, version.Windows)

	cmdhook := "somehook.cmd"
	c.Assert(uniter.HookCommand(cmdhook), gc.DeepEquals, []string{cmdhook})

	bathook := "somehook.bat"
	c.Assert(uniter.HookCommand(bathook), gc.DeepEquals, []string{bathook})

	restorer()
}
コード例 #2
0
ファイル: context_test.go プロジェクト: kapilt/juju
func (s *WindowsHookSuite) TestHookCommandPowerShellScript(c *gc.C) {
	restorer := envtesting.PatchValue(&version.Current.OS, version.Windows)

	hookname := "powerShellScript.ps1"
	expected := []string{
		"powershell.exe",
		"-NonInteractive",
		"-ExecutionPolicy",
		"RemoteSigned",
		"-File",
		hookname,
	}

	c.Assert(uniter.HookCommand(hookname), gc.DeepEquals, expected)
	restorer()
}