Refactor dry run test to reuse ETCD storage data

This change updates the ETCD storage test so that its data is
exported.  Thus it can be used by other tests.  The dry run test was
updated to consume this data instead of having a duplicate copy.

The code to start a master that can be used for "one of every
resource" style tests was also factored out.  It is reused in the
dry run test as well.

This prevents these tests from drifting in the future and reduces
the long term maintenance burden.

Signed-off-by: Monis Khan <mkhan@redhat.com>
This commit is contained in:
Monis Khan
2018-10-18 15:47:51 -04:00
parent 8b36038b41
commit c16edb2738
8 changed files with 844 additions and 1190 deletions

View File

@@ -67,7 +67,7 @@ func WaitForPodToDisappear(podClient coreclient.PodInterface, podName string, in
})
}
func GetEtcdKVClient(config storagebackend.Config) (clientv3.KV, error) {
func GetEtcdClients(config storagebackend.Config) (*clientv3.Client, clientv3.KV, error) {
tlsInfo := transport.TLSInfo{
CertFile: config.CertFile,
KeyFile: config.KeyFile,
@@ -76,7 +76,7 @@ func GetEtcdKVClient(config storagebackend.Config) (clientv3.KV, error) {
tlsConfig, err := tlsInfo.ClientConfig()
if err != nil {
return nil, err
return nil, nil, err
}
cfg := clientv3.Config{
@@ -86,8 +86,8 @@ func GetEtcdKVClient(config storagebackend.Config) (clientv3.KV, error) {
c, err := clientv3.New(cfg)
if err != nil {
return nil, err
return nil, nil, err
}
return clientv3.NewKV(c), nil
return c, clientv3.NewKV(c), nil
}