1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
15 func Test(t *testing.T) {
19 var _ = check.Suite(&Suite{})
23 // TestExtractGoVersion tests the grep/awk command used in
24 // tools/arvbox/bin/arvbox to extract the version of Go to install for
25 // bootstrapping `arvados-server`.
27 // If this test is changed, the arvbox code will also need to be updated.
28 func (*Suite) TestExtractGoVersion(c *check.C) {
30 sourcepath="$(realpath ../..)"
31 (cd ${sourcepath} && grep 'const goversion =' lib/install/deps.go |awk -F'"' '{print $2}')
33 cmd := exec.Command("bash", "-")
34 cmd.Stdin = bytes.NewBufferString("set -ex -o pipefail\n" + script)
35 cmdOutput, err := cmd.Output()
36 c.Assert(err, check.IsNil)
37 c.Assert(string(cmdOutput), check.Equals, goversion+"\n")