From d365c0e151aa39de88575cf9e182c51e33cb2c47 Mon Sep 17 00:00:00 2001
From: Yong Tang <yong.tang.github@outlook.com>
Date: Fri, 13 May 2016 20:39:35 -0700
Subject: [PATCH] Fix failed test for TestRestartPolicy

This commit is a follow up of the last commit:
Vendor engine-api to allow docker daemon reload event.

After vendor/engine-api has been updated, the following
unit test fails:
```
--- FAIL: TestRestartPolicy (0.00s)
       hostconfig_test.go:177: RestartPolicy.IsNone for { 0} should have been false but was true
```

The reason for the above failed unit test is that pull request:

https://github.com/docker/engine-api/pull/200

updated behavior of the restart policy and makes restartpolicy.IsNone
return true if restart policy name is `""`. As a result, the above
mentioned unit test fails.

This fix fixes the inconsistency of the unit test so that `TestRestartPolicy`
could pass again.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
---
 runconfig/hostconfig_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runconfig/hostconfig_test.go b/runconfig/hostconfig_test.go
index e14443ba98..1fbc90a4cf 100644
--- a/runconfig/hostconfig_test.go
+++ b/runconfig/hostconfig_test.go
@@ -166,7 +166,7 @@ func TestPidModeTest(t *testing.T) {
 func TestRestartPolicy(t *testing.T) {
 	restartPolicies := map[container.RestartPolicy][]bool{
 		// none, always, failure
-		container.RestartPolicy{}:                {false, false, false},
+		container.RestartPolicy{}:                {true, false, false},
 		container.RestartPolicy{"something", 0}:  {false, false, false},
 		container.RestartPolicy{"no", 0}:         {true, false, false},
 		container.RestartPolicy{"always", 0}:     {false, true, false},