Пример #1
0
func domainsTest(t *testing.T, cfg *utils.DeisTestConfig) {
	utils.Execute(t, domainsAddCmd, cfg, false, "done")
	// ensure both the root domain and the custom domain work
	utils.CurlApp(t, *cfg)
	utils.Curl(t, fmt.Sprintf("http://%s", cfg.AppDomain))
	utils.Execute(t, domainsRemoveCmd, cfg, false, "done")
	// only the root domain should work now
	utils.CurlApp(t, *cfg)
	// TODO (bacongobbler): add test to ensure that the custom domain fails to connect
}
Пример #2
0
func certsTest(t *testing.T, cfg *utils.DeisTestConfig) {
	utils.Execute(t, domainsAddCmd, cfg, false, "done")
	utils.Execute(t, certsAddCmd, cfg, false, cfg.AppDomain)
	// wait for the certs to be populated in the router; cron takes up to 1 minute
	fmt.Println("sleeping for 60 seconds until certs are generated...")
	time.Sleep(60 * time.Second)
	fmt.Println("ok")
	// ensure the custom domain's SSL endpoint works
	utils.Curl(t, fmt.Sprintf("https://%s", cfg.AppDomain))
	utils.Execute(t, certsRemoveCmd, cfg, false, "done")
	// only the root domain should work now
	utils.CurlApp(t, *cfg)
	// TODO (bacongobbler): add test to ensure that the custom domain fails to connect
}
Пример #3
0
func appsLogsTest(t *testing.T, params *utils.DeisTestConfig) {
	cmd := appsLogsCmd
	// test for application lifecycle logs
	utils.Execute(t, cmd, params, false, "204 NO CONTENT")
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, gitPushCmd, params, false, "")
	utils.Curl(t, params)
	utils.Execute(t, cmd, params, false, "")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
}
Пример #4
0
func appsLogsTest(t *testing.T, params *utils.DeisTestConfig) {
	cmd := appsLogsCmd
	utils.Execute(t, cmd, params, true, "204 NO CONTENT")
	if err := utils.Chdir(params.ExampleApp); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, gitPushCmd, params, false, "")
	// TODO: nginx needs a few seconds to wake up here--fixme!
	time.Sleep(5000 * time.Millisecond)
	utils.Curl(t, params)
	utils.Execute(t, cmd, params, false, "")
	if err := utils.Chdir(".."); err != nil {
		t.Fatal(err)
	}
}
Пример #5
0
func appsOpenTest(t *testing.T, params *utils.DeisTestConfig) {
	utils.Curl(t, params)
}