Skip to content

Commit

Permalink
test fail troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkasun committed Aug 15, 2023
1 parent a7d25f8 commit 4445752
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
19 changes: 7 additions & 12 deletions controllers/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/assert"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/gravitl/netclient/ncutils"
"github.com/gravitl/netmaker/functions"
"github.com/gravitl/netmaker/logic"
"github.com/gravitl/netmaker/models"
Expand Down Expand Up @@ -206,30 +205,26 @@ func TestCreateDNS(t *testing.T) {
func TestSetDNS(t *testing.T) {
deleteAllDNS(t)
deleteAllNetworks()
etc, err := os.Stat("/etc/hosts")
etc, err := os.ReadFile("/etc/hosts")
assert.Nil(t, err)
out, _ := ncutils.RunCmd("cat /etc/hosts", false)
t.Log(out)
err = functions.SetDNSDir()
assert.Nil(t, err)
t.Run("NoNetworks", func(t *testing.T) {
err := logic.SetDNS()
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
info, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
assert.Equal(t, etc.Size(), info.Size())
out, _ := ncutils.RunCmd("cat ./config/dnsconfig/netmaker.hosts", false)
t.Log(out)
//assert.False(t, info.IsDir())
assert.Equal(t, etc, info)
t.Log(string(etc), string(info))
})
t.Run("NoEntries", func(t *testing.T) {
createNet()
err := logic.SetDNS()
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
info, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
assert.Equal(t, etc.Size(), info.Size())
assert.Equal(t, etc, info)
})
t.Run("NodeExists", func(t *testing.T) {
createTestNode()
Expand Down
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ require (
require (
github.com/devilcove/httpclient v0.6.0
github.com/go-jose/go-jose/v3 v3.0.0
github.com/gravitl/netclient v0.20.5
github.com/guumaster/tablewriter v0.0.10
github.com/matryer/is v1.4.1
github.com/olekukonko/tablewriter v0.0.5
Expand All @@ -53,8 +52,6 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vishvananda/netlink v1.1.0 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
)

require (
Expand Down
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gravitl/netclient v0.20.5 h1:NfSCV6jd8YDuZ8qjBH6HJeS8AFVoxjHoMe3uSRw5nVY=
github.com/gravitl/netclient v0.20.5/go.mod h1:sU8Zg3+Rd8vRiD5EfxTTbhinyo/S3GcXhN2cSb390wk=
github.com/guumaster/tablewriter v0.0.10 h1:A0HD94yMdt4usgxBjoEceNeE0XMJ027euoHAzsPqBQs=
github.com/guumaster/tablewriter v0.0.10/go.mod h1:p4FRFhyfo0UD9ZLmMRbbJooTUsxo6b80qZTERVDWrH8=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
Expand Down Expand Up @@ -101,10 +99,6 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/txn2/txeh v1.5.3 h1:ZMgc3r+5/AFtE/ayCoICpvxj7xl/CYsZjnIGhozV/Kc=
github.com/txn2/txeh v1.5.3/go.mod h1:qYzGG9kCzeVEI12geK4IlanHWY8X4uy/I3NcW7mk8g4=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand All @@ -123,7 +117,6 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down

0 comments on commit 4445752

Please sign in to comment.