Просмотр исходного кода

Update integration test to account for SwarmKit change

The PKCS8 changes updated the encryption on the keys so that the
`x509.IsEncryptedPEMBlock` may no longer return true because it cannot
parse the PEM block. The `keyutils` module in SwarmKit can tell whether
it is encrypted either way.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 7 лет назад
Родитель
Сommit
ed7d7b9b05
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      integration-cli/docker_cli_swarm_test.go

+ 2 - 2
integration-cli/docker_cli_swarm_test.go

@@ -4,7 +4,6 @@ package main
 
 
 import (
 import (
 	"bytes"
 	"bytes"
-	"crypto/x509"
 	"encoding/json"
 	"encoding/json"
 	"encoding/pem"
 	"encoding/pem"
 	"fmt"
 	"fmt"
@@ -25,6 +24,7 @@ import (
 	"github.com/docker/libnetwork/driverapi"
 	"github.com/docker/libnetwork/driverapi"
 	"github.com/docker/libnetwork/ipamapi"
 	"github.com/docker/libnetwork/ipamapi"
 	remoteipam "github.com/docker/libnetwork/ipams/remote/api"
 	remoteipam "github.com/docker/libnetwork/ipams/remote/api"
+	"github.com/docker/swarmkit/ca/keyutils"
 	"github.com/go-check/check"
 	"github.com/go-check/check"
 	"github.com/gotestyourself/gotestyourself/fs"
 	"github.com/gotestyourself/gotestyourself/fs"
 	"github.com/gotestyourself/gotestyourself/icmd"
 	"github.com/gotestyourself/gotestyourself/icmd"
@@ -1007,7 +1007,7 @@ func checkKeyIsEncrypted(d *daemon.Swarm) func(*check.C) (interface{}, check.Com
 			return fmt.Errorf("invalid PEM-encoded private key"), nil
 			return fmt.Errorf("invalid PEM-encoded private key"), nil
 		}
 		}
 
 
-		return x509.IsEncryptedPEMBlock(keyBlock), nil
+		return keyutils.IsEncryptedPEMBlock(keyBlock), nil
 	}
 	}
 }
 }