github.com/coreos/mantle@v0.13.0/kola/tests/misc/tls.go (about)

     1  // Copyright 2018 Red Hat
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package misc
    16  
    17  import (
    18  	"fmt"
    19  
    20  	"github.com/coreos/mantle/kola/cluster"
    21  	"github.com/coreos/mantle/kola/register"
    22  )
    23  
    24  var (
    25  	urlsToFetch = []string{
    26  		"https://www.example.com/",
    27  		"https://www.wikipedia.org/",
    28  		"https://start.fedoraproject.org/",
    29  	}
    30  )
    31  
    32  func init() {
    33  	register.Register(&register.Test{
    34  		Run:            TestTLSFetchURLs,
    35  		ClusterSize:    1,
    36  		Name:           "coreos.tls.fetch-urls",
    37  		Flags:          []register.Flag{register.RequiresInternetAccess}, // Networking outside cluster required
    38  		ExcludeDistros: []string{"rhcos", "fcos"},                        // wget not included in *COS
    39  	})
    40  }
    41  
    42  func TestTLSFetchURLs(c cluster.TestCluster) {
    43  	m := c.Machines()[0]
    44  
    45  	for _, url := range urlsToFetch {
    46  		c.MustSSH(m, fmt.Sprintf("curl -s -S -m 30 --retry 2 %s", url))
    47  		c.MustSSH(m, fmt.Sprintf("wget -nv -T 30 -t 2 --delete-after %s 2> >(grep -v -- '->' >&2)", url))
    48  	}
    49  }