From 1fa35a166cee057223e11428367210b9ea7a0a0d Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 27 Aug 2024 12:47:04 +0200 Subject: Exports: Test setting states --- exports/exports_test_wrapper.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'exports') 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) -- cgit v1.2.3