Skip to content

Commit

Permalink
Exports: Test setting states
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed Aug 27, 2024
1 parent 6b32bf7 commit e2d046b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions exports/exports_test_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e2d046b

Please sign in to comment.