16053: Add debian:10 install-and-boot test.
authorTom Clegg <tom@tomclegg.ca>
Mon, 16 Mar 2020 21:00:21 +0000 (17:00 -0400)
committerTom Clegg <tom@tomclegg.ca>
Mon, 16 Mar 2020 21:00:21 +0000 (17:00 -0400)
Run with "go test -check.vv -tags docker".

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/install/deps_test.go [new file with mode: 0644]

diff --git a/lib/install/deps_test.go b/lib/install/deps_test.go
new file mode 100644 (file)
index 0000000..d3e6398
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+// Skip this slow test unless invoked as "go test -tags docker":
+// +build docker
+
+package install
+
+import (
+       "os"
+       "testing"
+
+       "gopkg.in/check.v1"
+)
+
+func Test(t *testing.T) {
+       check.TestingT(t)
+}
+
+var _ = check.Suite(&Suite{})
+
+type Suite struct{}
+
+func (*Suite) TestInstallDeps(c *check.C) {
+       tmp := c.MkDir()
+       script := `
+set -x
+export GOPATH=${GOPATH:-${HOME}/go}
+tmp="` + tmp + `"
+sourcepath="$(realpath ../..)"
+(cd ${sourcepath} && go build -o ${tmp} ./cmd/arvados-server)
+docker run -i --rm --workdir /arvados \
+       -v ${tmp}/arvados-server:/arvados-server:ro \
+       -v ${sourcepath}:/arvados:ro \
+       -v /arvados/services/api/.bundle \
+       -v /arvados/apps/workbench/.bundle \
+       --env http_proxy \
+       --env https_proxy \
+       debian:10 \
+       bash -c "/arvados-server install -type test && /arvados-server boot -type test -config doc/examples/config/zzzzz.yml -own-temporary-database -shutdown -timeout 9m"
+`
+       c.Check(runBash(script, os.Stdout, os.Stderr), check.IsNil)
+}