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")
35 defer os.RemoveAll(tmpdir)
36 err := os.Chmod(tmpdir, 0755)
37 c.Assert(err, check.IsNil)
39 cmd := exec.Command("go", "run", ".",
41 "-package-dir", tmpdir,
42 "-package-version", "1.2.3~rc4",
45 cmd.Stdout = os.Stderr
46 cmd.Stderr = os.Stderr
48 c.Check(err, check.IsNil)
50 fi, err := os.Stat(tmpdir + "/arvados-server-easy_1.2.3~rc4_amd64.deb")
51 c.Assert(err, check.IsNil)
54 buf, _ := exec.Command("ls", "-l", tmpdir).CombinedOutput()
57 cmd = exec.Command("go", "run", ".",
59 "-package-dir", tmpdir,
60 "-package-version", "1.2.3~rc4",
62 cmd.Stdout = os.Stderr
63 cmd.Stderr = os.Stderr
65 c.Check(err, check.IsNil)
67 err = os.RemoveAll(tmpdir)
68 c.Check(err, check.IsNil)