Remove up_test (#268)

up_test is redundant because it is tested in
up_daemon_test

Co-authored-by: mlsmaycon <mlsmaycon@gmail.com>
This commit is contained in:
Mikhail Bragin 2022-03-14 17:33:15 +01:00 committed by GitHub
parent 3a69f334e8
commit 957474817f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 66 deletions

View File

@ -64,6 +64,7 @@ jobs:
-
name: Trigger Windows binaries sign pipeline
uses: benc-uk/workflow-dispatch@v1
if: startsWith(github.ref, 'refs/tags/')
with:
workflow: Sign windows bin and installer
repo: wiretrustee/windows-sign-pipeline

View File

@ -8,6 +8,10 @@ import (
"github.com/wiretrustee/wiretrustee/client/internal"
)
var (
cliAddr string
)
func TestUpDaemon(t *testing.T) {
mgmAddr := startTestingServices(t)

View File

@ -1,66 +0,0 @@
package cmd
import (
"net/url"
"testing"
"time"
"github.com/wiretrustee/wiretrustee/iface"
)
var (
//signalAddr string
cliAddr string
)
func TestUp(t *testing.T) {
mgmAddr := startTestingServices(t)
tempDir := t.TempDir()
confPath := tempDir + "/config.json"
mgmtURL, err := url.Parse("http://" + mgmAddr)
if err != nil {
t.Fatal(err)
}
rootCmd.SetArgs([]string{
"up",
"--config",
confPath,
"--setup-key",
"A2C8E62B-38F5-4553-B31E-DD66C696CEBB",
"--management-url",
mgmtURL.String(),
"--log-level",
"debug",
"--log-file",
"console",
})
go func() {
if err := rootCmd.Execute(); err != nil {
t.Errorf("expected no error while running up command, got %v", err)
}
}()
time.Sleep(time.Second * 2)
timeout := 30 * time.Second
timeoutChannel := time.After(timeout)
for {
select {
case <-timeoutChannel:
t.Fatalf("expected wireguard interface %s to be created before %s", iface.WgInterfaceDefault, timeout.String())
default:
}
e, err := iface.Exists(iface.WgInterfaceDefault)
if err != nil {
continue
}
if err != nil {
continue
}
if *e {
break
}
}
}