Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Go client for OpenVPN [management interface](https://openvpn.net/index.php/open-

## Installation

go get github.com/nklizhe/ovpnutil
go get github.com/oashnic/ovpnutil

## License

Expand Down
56 changes: 56 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,62 @@ func TestGetStates(t *testing.T) {
fmt.Println(states)
}

func TestGetStatus(t *testing.T) {
ctl, err := Dial("127.0.0.1:1337")
assert.NoError(t, err)
assert.NotNil(t, ctl)

defer ctl.Close()

status, err := ctl.GetStatus()
assert.NoError(t, err)
assert.NotEmpty(t, status)

fmt.Println(status)
}

func TestGetClients(t *testing.T) {
ctl, err := Dial("127.0.0.1:1337")
assert.NoError(t, err)
assert.NotNil(t, ctl)

defer ctl.Close()

clients, err := ctl.GetClients()
assert.NoError(t, err)
assert.NotEmpty(t, clients)

fmt.Println(clients)
}

func TestGetRouting(t *testing.T) {
ctl, err := Dial("127.0.0.1:1337")
assert.NoError(t, err)
assert.NotNil(t, ctl)

defer ctl.Close()

routing, err := ctl.GetRouting()
assert.NoError(t, err)
assert.NotEmpty(t, routing)

fmt.Println(clients)
}

func TestGetGlobalStats(t *testing.T) {
ctl, err := Dial("127.0.0.1:1337")
assert.NoError(t, err)
assert.NotNil(t, ctl)

defer ctl.Close()

stats, err := ctl.GetGlobalStats()
assert.NoError(t, err)
assert.NotEmpty(t, stats)

fmt.Println(stats)
}

func TestSubscribeByteCount(t *testing.T) {
ctl, err := Dial("127.0.0.1:1337")
assert.NoError(t, err)
Expand Down
Loading