Skip to content

Run "make test" on Travis CI #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
run:
timeout: 5m

linters:
disable-all: true
enable:
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ install:
- make deps

script:
# "make" must be happening before "make lint" to download dependencies
- make
- make lint
- make test
13 changes: 11 additions & 2 deletions runtime/service_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,13 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
assert.Equalf(t, "45", stdout, "container %q did not emit expected stdout", containerName)
}

func exitCode(err *exec.ExitError) int {
if status, ok := err.Sys().(syscall.WaitStatus); ok {
return int(status)
}
return -1
}

// TestRandomness validates that there is a reasonable amount of entropy available to the VM and thus
// randomness available to containers (test reads about 2.5MB from /dev/random w/ an overall test
// timeout of 60 seconds). It also validates that the quality of the randomness passes the rngtest
Expand Down Expand Up @@ -1201,9 +1208,11 @@ func TestRandomness_Isolated(t *testing.T) {
// Even though we have a failure tolerance, the test still provides some
// value in that we can be aware if a change to the rootfs results in a
// regression.
require.EqualValues(t, 1, rngtestCmd.ProcessState.ExitCode())
const failureTolerance = 4
exitErr, ok := err.(*exec.ExitError)
require.True(t, ok, "the error is not ExitError")
require.EqualValues(t, 1, exitCode(exitErr))

const failureTolerance = 4
for _, outputLine := range strings.Split(rngtestStderr.String(), "\n") {
var failureCount int
_, err := fmt.Sscanf(strings.TrimSpace(outputLine), "rngtest: FIPS 140-2 failures: %d", &failureCount)
Expand Down