-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: report unhealthy in unsupported Windows
On Windows, Nomad only supports Windows containers, so report as unhealthy otherwise.
- Loading branch information
Mahmood Ali
committed
Feb 24, 2019
1 parent
fb06c8e
commit 3d281c1
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package docker | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/nomad/client/testutil" | ||
"github.com/hashicorp/nomad/helper/testlog" | ||
"github.com/hashicorp/nomad/plugins/drivers" | ||
tu "github.com/hashicorp/nomad/testutil" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// TestDockerDriver_FingersprintHealth asserts that docker reports healthy | ||
// whenever Docker is supported. In particular. | ||
// | ||
// In Linux CI and AppVeyor Windows environment, it should be enabled. | ||
func TestDockerDriver_FingerprintHealth(t *testing.T) { | ||
if !tu.IsCI() { | ||
t.Parallel() | ||
} | ||
testutil.DockerCompatible(t) | ||
|
||
d := NewDockerDriver(testlog.HCLogger(t)).(*Driver) | ||
|
||
fp := d.buildFingerprint() | ||
require.Equal(t, drivers.HealthStateHealthy, fp.Health) | ||
} |