summaryrefslogtreecommitdiff
path: root/exports/exports_test_wrapper.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-08-27 12:47:04 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-10-28 17:02:14 +0100
commit1fa35a166cee057223e11428367210b9ea7a0a0d (patch)
treeaa97561ee3818e7e4df99df436abdc2c61fdeefe /exports/exports_test_wrapper.go
parentd2e3776bf807386640488ba96500f30aa3fc153e (diff)
Exports: Test setting states
Diffstat (limited to 'exports/exports_test_wrapper.go')
-rw-r--r--exports/exports_test_wrapper.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/exports/exports_test_wrapper.go b/exports/exports_test_wrapper.go
index b103852..6a56672 100644
--- a/exports/exports_test_wrapper.go
+++ b/exports/exports_test_wrapper.go
@@ -450,6 +450,29 @@ func testGetConfig(t *testing.T) {
t.Fatalf("VPN config does not match regex: %v", cfgS)
}
+ // 7 = GotConfig
+ stateIn, statErr := InState(7)
+ statErrS := getError(t, statErr)
+ if statErrS != "" {
+ t.Fatalf("got a state error when checking if client is in state: %v", statErr)
+ }
+ if stateIn == 0 {
+ t.Fatal("client is not in State 7: GotConfig")
+ }
+ setState := func(in C.int) {
+ // set state connecting
+ statErr := getError(t, SetState(in))
+ if statErr != "" {
+ t.Fatalf("failed to set state: %v, err: %v", in, statErr)
+ }
+ }
+
+ // set connecting -> connected -> disconnecting -> disconnected
+ setState(8)
+ setState(9)
+ setState(10)
+ setState(11)
+
testExpiryTimes(t)
testSetProfileID(t)
testRenewSession(t)