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{})
24 TestExtractGoVersion tests the grep/awk command used in
25 tools/arvbox/bin/arvbox to extract the version of Go to install for
26 bootstrapping `arvados-server`.
28 If this test is changed, the arvbox code will also need to be updated.
30 func (*Suite) TestExtractGoVersion(c *check.C) {
32 sourcepath="$(realpath ../..)"
33 (cd ${sourcepath} && grep 'const goversion =' lib/install/deps.go |awk -F'"' '{print $2}')
35 cmd := exec.Command("bash", "-")
36 cmd.Stdin = bytes.NewBufferString("set -ex -o pipefail\n" + script)
37 cmdOutput, err := cmd.Output()
38 c.Assert(err, check.IsNil)
39 c.Assert(string(cmdOutput), check.Equals, goversion+"\n")