summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-10-04 15:11:31 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-10-04 15:11:31 +0200
commitb950e027b3553ccc767f88be8e88a1b3acf1b383 (patch)
tree5342e9fd19b8d2704866c137b57a78ee0d665e74
parent47d8fafada8c7c1377b9172862f25c576c4c3c08 (diff)
Tests: Remove local well known workaround
See: https://github.com/eduvpn/vpn-user-portal/pull/204 as an alternative
-rw-r--r--docs/src/gettingstarted/testing.md1
-rw-r--r--state_test.go19
2 files changed, 0 insertions, 20 deletions
diff --git a/docs/src/gettingstarted/testing.md b/docs/src/gettingstarted/testing.md
index f3a47b6..62abfaf 100644
--- a/docs/src/gettingstarted/testing.md
+++ b/docs/src/gettingstarted/testing.md
@@ -29,7 +29,6 @@ This script is also used in the continuous integration, so we recommend to run t
There are other environment variables that can be used:
- `OAUTH_EXPIRED_TTL`: Use this for a server which has a low OAuth access token expiry time, e.g. 10 seconds. You would then set this variable to `"10"` so that a test is ran which waits for 10 seconds for the OAuth tokens to expire
-- `SERVER_IS_LOCAL`: Set this to `"1"` such that the server endpoints are taken from `$SERVER_URI/well-known.php` instead of `SERVER_URI/.well-known/vpn-user-portal`. This is common for local development servers
## Testing the wrappers
To test the wrappers, issue the following command in a shell (you will need dependencies for all wrappers if you do this[^1]):
diff --git a/state_test.go b/state_test.go
index 849c735..c665958 100644
--- a/state_test.go
+++ b/state_test.go
@@ -17,14 +17,6 @@ import (
"github.com/eduvpn/eduvpn-common/types"
)
-func ensureLocalWellKnown() {
- wellKnown := os.Getenv("SERVER_IS_LOCAL")
-
- if wellKnown == "1" {
- server.WellKnownPath = "well-known.php"
- }
-}
-
func getServerURI(t *testing.T) string {
serverURI := os.Getenv("SERVER_URI")
if serverURI == "" {
@@ -80,7 +72,6 @@ func stateCallback(
func Test_server(t *testing.T) {
serverURI := getServerURI(t)
state := &VPNState{}
- ensureLocalWellKnown()
registerErr := state.Register(
"org.eduvpn.app.linux",
@@ -168,8 +159,6 @@ func Test_connect_oauth_parameters(t *testing.T) {
{&failedCallbackStateMatchError, httpw.URLParameters{"code": "42", "state": "21"}},
}
- ensureLocalWellKnown()
-
for _, test := range tests {
test_connect_oauth_parameter(t, test.parameters, test.expectedErr)
}
@@ -185,8 +174,6 @@ func Test_token_expired(t *testing.T) {
return
}
- ensureLocalWellKnown()
-
// Convert the env variable to an int and signal error if it is not possible
expiredInt, expiredErr := strconv.Atoi(expiredTTL)
if expiredErr != nil {
@@ -250,8 +237,6 @@ func Test_token_invalid(t *testing.T) {
serverURI := getServerURI(t)
state := &VPNState{}
- ensureLocalWellKnown()
-
registerErr := state.Register(
"org.eduvpn.app.linux",
"configsinvalid",
@@ -303,8 +288,6 @@ func Test_invalid_profile_corrected(t *testing.T) {
serverURI := getServerURI(t)
state := &VPNState{}
- ensureLocalWellKnown()
-
registerErr := state.Register(
"org.eduvpn.app.linux",
"configscancelprofile",
@@ -356,8 +339,6 @@ func Test_prefer_tcp(t *testing.T) {
serverURI := getServerURI(t)
state := &VPNState{}
- ensureLocalWellKnown()
-
registerErr := state.Register(
"org.eduvpn.app.linux",
"configsprefertcp",