Remove redundant config & secret integration tests

The tests performed by integration tests TestConfigCreateWithFile and
TestSecretCreateWithFile are already covered by integration tests under
integration/config and integration/secret, respectively, except for the
use of an input file. The latter is also covered by unit tests for
config and secret commands under docker/cli, making the above
integration tests redundant.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This commit is contained in:
Arash Deshmeh 2018-09-27 13:41:41 -04:00
parent 87e7930892
commit ef490e0368
2 changed files with 0 additions and 66 deletions

View file

@ -1,33 +0,0 @@
// +build !windows
package main
import (
"io/ioutil"
"os"
"strings"
"github.com/docker/docker/integration-cli/checker"
"github.com/go-check/check"
)
func (s *DockerSwarmSuite) TestConfigCreateWithFile(c *check.C) {
d := s.AddDaemon(c, true, true)
testFile, err := ioutil.TempFile("", "configCreateTest")
c.Assert(err, checker.IsNil) // ensure temp file is created
defer os.Remove(testFile.Name())
testData := "TESTINGDATA"
_, err = testFile.Write([]byte(testData))
c.Assert(err, checker.IsNil) // ensure temp file is written
testName := "test_config"
out, err := d.Cmd("config", "create", testName, testFile.Name())
c.Assert(err, checker.IsNil, check.Commentf("%s", out))
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "")
id := strings.TrimSpace(out)
config := d.GetConfig(c, id)
c.Assert(config.Spec.Name, checker.Equals, testName)
}

View file

@ -1,33 +0,0 @@
// +build !windows
package main
import (
"io/ioutil"
"os"
"strings"
"github.com/docker/docker/integration-cli/checker"
"github.com/go-check/check"
)
func (s *DockerSwarmSuite) TestSecretCreateWithFile(c *check.C) {
d := s.AddDaemon(c, true, true)
testFile, err := ioutil.TempFile("", "secretCreateTest")
c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
defer os.Remove(testFile.Name())
testData := "TESTINGDATA"
_, err = testFile.Write([]byte(testData))
c.Assert(err, checker.IsNil, check.Commentf("failed to write to temporary file"))
testName := "test_secret"
out, err := d.Cmd("secret", "create", testName, testFile.Name())
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "", check.Commentf("%s", out))
id := strings.TrimSpace(out)
secret := d.GetSecret(c, id)
c.Assert(secret.Spec.Name, checker.Equals, testName)
}