Skip to content

Commit

Permalink
Fix up certloader tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
csstaub committed Oct 11, 2018
1 parent 9a5a678 commit eecb394
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ build_script:
- set CGO_ENABLED=1
- go build -o ghostunnel-%GIT_VERSION%-windows-%GOARCH%-with-pkcs11.exe -ldflags "-w -extldflags \"-static\" -extld=%EXTLD%" -i .
# Execute tests
- go test -v . ./auth ./certloader ./proxy ./wildcard
- go test -v ./...
6 changes: 6 additions & 0 deletions certloader/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"crypto/tls"
"io/ioutil"
"os"
"runtime"
"testing"
"unsafe"

Expand Down Expand Up @@ -95,6 +96,11 @@ func TestCertificateFromPEMFilesValid(t *testing.T) {
assert.Nil(t, cert.Reload(), "should be able to reload")

// Remove file & test reload failure
if runtime.GOOS == "windows" {
// Reloading not supported on Windows
return
}

os.Remove(file.Name())
assert.NotNil(t, cert.Reload(), "should not be able to reload")
}
Expand Down

0 comments on commit eecb394

Please sign in to comment.