Esempio n. 1
0
func TestBuilds(t *testing.T) {
	params := buildSetup(t)
	buildsListTest(t, params)
	appsOpenTest(t, params)
	utils.AppsDestroyTest(t, params)
	buildsCreateTest(t, params)
	// TODO: router needs a few seconds to wake up here--fixme!
	time.Sleep(5000 * time.Millisecond)
	appsOpenTest(t, params)
	utils.AppsDestroyTest(t, params)
}
Esempio n. 2
0
func TestPs(t *testing.T) {
	params := psSetup(t)
	psScaleTest(t, params, psScaleCmd)
	appsOpenTest(t, params)
	psListTest(t, params, false)
	psScaleTest(t, params, psRestartCmd)
	psScaleTest(t, params, psDownScaleCmd)

	// FIXME if we don't wait here, some of the routers may give us a 502 before
	// the app is removed from the config.
	// we wait 7 seconds since confd reloads every 5 seconds
	time.Sleep(time.Millisecond * 7000)

	// test for a 503 response
	utils.CurlWithFail(t, fmt.Sprintf("http://%s.%s", params.AppName, params.Domain), true, "503")

	utils.AppsDestroyTest(t, params)
	utils.Execute(t, psScaleCmd, params, true, "404 NOT FOUND")
	// ensure we can choose our preferred beverage
	utils.Execute(t, psScaleCmd, params, true, "but first, coffee!")
	if err := os.Setenv("DEIS_DRINK_OF_CHOICE", "tea"); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, psScaleCmd, params, true, "but first, tea!")
}
Esempio n. 3
0
func TestHealthcheck(t *testing.T) {
	client := utils.HTTPClient()
	cfg := healthcheckSetup(t)
	done := make(chan bool, 1)
	url := fmt.Sprintf("http://%s.%s", cfg.AppName, cfg.Domain)

	utils.Execute(t, healthcheckGoodCmd, cfg, false, "/")
	go func() {
		// there should never be any downtime during these health check operations
		psScaleTest(t, cfg, psScaleCmd)
		cfg.ProcessNum = "1"
		psScaleTest(t, cfg, psScaleCmd)
		// kill healthcheck goroutine
		done <- true
	}()

	// run health checks in parallel while performing operations
	fmt.Printf("starting health checks at %s\n", url)
loop:
	for {
		select {
		case <-done:
			fmt.Println("done performing health checks")
			break loop
		default:
			doHealthCheck(t, client, url)
		}
	}
	utils.AppsDestroyTest(t, cfg)
}
Esempio n. 4
0
func TestPs(t *testing.T) {
	params := psSetup(t)
	psScaleTest(t, params)
	appsOpenTest(t, params)
	psListTest(t, params, false)
	utils.AppsDestroyTest(t, params)
	utils.Execute(t, psScaleCmd, params, true, "404 NOT FOUND")
}
Esempio n. 5
0
func TestReleases(t *testing.T) {
	params := releasesSetup(t)
	releasesListTest(t, params, false)
	releasesInfoTest(t, params)
	releasesRollbackTest(t, params)
	appsOpenTest(t, params)
	params.Version = "4"
	releasesListTest(t, params, false)
	utils.AppsDestroyTest(t, params)

}
Esempio n. 6
0
func TestPerms(t *testing.T) {
	params := permsSetup(t)
	user := utils.GetGlobalConfig()
	user.UserName, user.Password = "******", "test1"
	user.AppName = params.AppName
	utils.Execute(t, authRegisterCmd, user, false, "")
	permsCreateAppTest(t, params, user)
	permsDeleteAppTest(t, params, user)
	permsCreateAdminTest(t, params)
	permsDeleteAdminTest(t, params)
	utils.AppsDestroyTest(t, params)
}
Esempio n. 7
0
func TestPs(t *testing.T) {
	params := psSetup(t)
	psScaleTest(t, params)
	appsOpenTest(t, params)
	psListTest(t, params, false)
	utils.AppsDestroyTest(t, params)
	utils.Execute(t, psScaleCmd, params, true, "404 NOT FOUND")
	// ensure we can choose our preferred beverage
	utils.Execute(t, psScaleCmd, params, true, "but first, coffee!")
	if err := os.Setenv("DEIS_DRINK_OF_CHOICE", "tea"); err != nil {
		t.Fatal(err)
	}
	utils.Execute(t, psScaleCmd, params, true, "but first, tea!")
}
Esempio n. 8
0
func TestConfig(t *testing.T) {
	params := configSetup(t)
	configSetTest(t, params)
	configListTest(t, params, false)
	appsOpenTest(t, params)
	configUnsetTest(t, params)
	configListTest(t, params, true)
	limitsSetTest(t, params, 4)
	appsOpenTest(t, params)
	limitsUnsetTest(t, params, 6)
	appsOpenTest(t, params)
	//tagsTest(t, params, 8)
	appsOpenTest(t, params)
	utils.AppsDestroyTest(t, params)
}
Esempio n. 9
0
func TestDomains(t *testing.T) {
	cfg := domainsSetup(t)
	domainsTest(t, cfg)
	certsTest(t, cfg)
	utils.AppsDestroyTest(t, cfg)
}