Skip to content

Commit

Permalink
Add refresh token test
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Nov 2, 2024
1 parent b2222a8 commit 9c69ee3
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion internal/openvpn/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func TestClientFull(t *testing.T) {
nil,
},
{
"client invalid reason",
"client invalid reason 1",
config.Config{
HTTP: config.HTTP{
BaseURL: &url.URL{Scheme: "http", Host: "localhost"},
Expand All @@ -265,6 +265,25 @@ func TestClientFull(t *testing.T) {
//nolint:revive
errors.New("OpenVPN management error: error parsing client message: unable to parse client reason from message: >CLIENT:FOO,0\r\n>CLIENT:ENV,common_name=bypass\r\n>CLIENT:ENV,END\r\n"),
},
{
"client invalid reason 2",
config.Config{
HTTP: config.HTTP{
BaseURL: &url.URL{Scheme: "http", Host: "localhost"},
Secret: testutils.Secret,
},
OpenVpn: config.OpenVpn{
CommonName: config.OpenVPNCommonName{
EnvironmentVariableName: "common_name",
},
Bypass: config.OpenVpnBypass{CommonNames: []string{"bypass"}},
Password: "password",
},
},
">CLIENT:CONNECT1,0,1\r\n>CLIENT:ENV,common_name=bypass\r\n>CLIENT:ENV,END\r\n",
"",
errors.New("OpenVPN management error: unknown client reason: CONNECT1"),
},
}

for _, tt := range confs {
Expand Down

0 comments on commit 9c69ee3

Please sign in to comment.