1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
18 os.Args = append(os.Args, "-test.timeout=30m") // kludge
21 type BuildSuite struct{}
23 var _ = check.Suite(&BuildSuite{})
25 func Test(t *testing.T) { check.TestingT(t) }
27 func (s *BuildSuite) TestBuildAndInstall(c *check.C) {
29 c.Skip("skipping docker tests in short mode")
30 } else if _, err := exec.Command("docker", "info").CombinedOutput(); err != nil {
31 c.Skip("skipping docker tests because docker is not available")
34 defer os.RemoveAll(tmpdir)
35 err := os.Chmod(tmpdir, 0755)
36 c.Assert(err, check.IsNil)
38 cmd := exec.Command("go", "run", ".",
40 "-package-dir", tmpdir,
41 "-package-version", "1.2.3~rc4",
44 cmd.Stdout = os.Stderr
45 cmd.Stderr = os.Stderr
47 c.Check(err, check.IsNil)
49 fi, err := os.Stat(tmpdir + "/arvados-server-easy_1.2.3~rc4_amd64.deb")
50 c.Assert(err, check.IsNil)
53 buf, _ := exec.Command("ls", "-l", tmpdir).CombinedOutput()
56 cmd = exec.Command("go", "run", ".",
58 "-package-dir", tmpdir,
59 "-package-version", "1.2.3~rc4",
61 cmd.Stdout = os.Stderr
62 cmd.Stderr = os.Stderr
64 c.Check(err, check.IsNil)
66 err = os.RemoveAll(tmpdir)
67 c.Check(err, check.IsNil)