harbor/tests/startuptest.go
Yan 038d7dd90c Dev new ui (#1)
* Updates for verfied tags deletion.

* Remove old UI.

* Move i18n folder.

* Updates for latest UI codes.

* make travis with latest dev code.

* update test code

* add cat log

* cat nginx

* cat nginx

* fix template error

* remove --with-notary

* remove controller test

* fix controller test bug

* modify controller test

* debug controller test

* update controller test

* update index title to harbor, discussed with Kun.

* Update package.json

* Merge latest UI changes.

* remove git
2017-03-20 18:51:20 +08:00

50 lines
877 B
Go

// Fetch prints the content found at a URL.
package main
import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"time"
)
func main() {
time.Sleep(60 * time.Second)
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
var client = &http.Client{
Timeout: time.Second * 30,
Transport: tr,
}
for _, url := range os.Args[1:] {
resp, err := client.Get(url)
if err != nil {
fmt.Fprintf(os.Stderr, "fetch: %v\n", err)
os.Exit(1)
}
b, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
fmt.Fprintf(os.Stderr, "fetch: reading %s: %v\n", url, err)
os.Exit(1)
}
// fmt.Printf("%s", b)
if strings.Contains(string(b), "Harbor") {
fmt.Printf("sucess!\n")
} else {
fmt.Println("the response does not contain \"Harbor\"!")
fmt.Println(string(b))
os.Exit(1)
}
}
}