Example #1
0
func (s *DevTestStepGuestScript) Run(c *otto.Core) error {
	log.Printf("[INFO] test: testing guest script: %q", s.Command)
	return c.Execute(&otto.ExecuteOpts{
		Task:   otto.ExecuteTaskDev,
		Action: "vagrant",
		Args: []string{
			"ssh", "-c", s.Command,
		},
	})
}
Example #2
0
// DevTestTeardown implements the otto.TestTeardownFunc type and should
// be used with otto.TestCase to clear out development environments cleanly.
func DevTestTeardown(c *otto.Core) error {
	// Destroy the dev environment. This should work even if it isn't
	// running so we can always execute it.
	log.Printf("[INFO] test: destroying the development environment")
	err := c.Execute(&otto.ExecuteOpts{
		Task:   otto.ExecuteTaskDev,
		Action: "destroy",
	})
	if err != nil {
		return err
	}

	// Delete all the layers
	return c.Execute(&otto.ExecuteOpts{
		Task:   otto.ExecuteTaskDev,
		Action: "layers",
		Args:   []string{"-prune"},
	})
}
Example #3
0
func (s *DevTestStepInit) Run(c *otto.Core) error {
	log.Printf("[INFO] test: starting the development environment")
	return c.Dev()
}