debian-forge-composer/cmd/osbuild-weldr-tests/main.go
Brian C. Lane 46c3bed153 client: Use http.Client instead of a string for the socket
This converts the client and weldrcheck functions to use http.Client for
connections instead of passing around the socket path and opening it for
each test.
2020-03-09 18:02:54 +01:00

26 lines
571 B
Go

// osbuild-tests runs all of the osbuild integration tests against a live server
// Copyright (C) 2020 by Red Hat, Inc.
package main
import (
"context"
"net"
"net/http"
"time"
"github.com/osbuild/osbuild-composer/internal/weldrcheck"
)
func main() {
client := &http.Client{
// TODO This may be too short/simple for downloading images
Timeout: 60 * time.Second,
Transport: &http.Transport{
DialContext: func(_ context.Context, _, _ string) (net.Conn, error) {
return net.Dial("unix", "/run/weldr/api.socket")
},
},
}
weldrcheck.Run(client)
}