summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-02-24 14:08:46 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-26 15:21:20 +0000
commitf9ddc0efa84938902987cbef8609f4e1e1e06a7d (patch)
tree1971ede39f2c06e606f8bb6175543363fd8a501b /meta/lib/oeqa
parent1fe4a25f2244fdf67d96109dcb4f49ed75c18b32 (diff)
downloadpoky-f9ddc0efa84938902987cbef8609f4e1e1e06a7d.tar.gz
selftest: Replace building dep tool with direnv
dep tool is now deprecated and its replaced with go modules so using this as sample for testing is also getting arcane. Replace it with another project direnv[1] which is quite active and uptodate [1] https://github.com/direnv/direnv (From OE-Core rev: bb510037beaaaa723b9158d1f4e11a3547f6fb73) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/gotoolchain.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gotoolchain.py b/meta/lib/oeqa/selftest/cases/gotoolchain.py
index 3119520f0d..4fc3605f42 100644
--- a/meta/lib/oeqa/selftest/cases/gotoolchain.py
+++ b/meta/lib/oeqa/selftest/cases/gotoolchain.py
@@ -46,26 +46,25 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
46 shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True) 46 shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
47 super(oeGoToolchainSelfTest, cls).tearDownClass() 47 super(oeGoToolchainSelfTest, cls).tearDownClass()
48 48
49 def run_sdk_go_command(self, gocmd): 49 def run_sdk_go_command(self, gocmd, proj, name):
50 cmd = "cd %s; " % self.tmpdir_SDKQA 50 cmd = "cd %s/src/%s/%s; " % (self.go_path, proj, name)
51 cmd = cmd + ". %s; " % self.env_SDK 51 cmd = cmd + ". %s; " % self.env_SDK
52 cmd = cmd + "export GOPATH=%s; " % self.go_path 52 cmd = cmd + "export GOPATH=%s; " % self.go_path
53 cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd 53 cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd
54 return runCmd(cmd).status 54 return runCmd(cmd).status
55 55
56 def test_go_dep_build(self): 56 def test_go_dep_build(self):
57 proj = "github.com/golang" 57 proj = "github.com/direnv"
58 name = "dep" 58 name = "direnv"
59 ver = "v0.3.1" 59 ver = "v2.27.0"
60 archive = ".tar.gz" 60 archive = ".tar.gz"
61 url = "https://%s/%s/archive/%s%s" % (proj, name, ver, archive) 61 url = "https://%s/%s/archive/%s%s" % (proj, name, ver, archive)
62 62
63 runCmd("cd %s; wget %s" % (self.tmpdir_SDKQA, url)) 63 runCmd("cd %s; wget %s" % (self.tmpdir_SDKQA, url))
64 runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver+archive)) 64 runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver+archive))
65 runCmd("mkdir -p %s/src/%s" % (self.go_path, proj)) 65 runCmd("mkdir -p %s/src/%s" % (self.go_path, proj))
66 runCmd("mv %s/dep-0.3.1 %s/src/%s/%s" 66 runCmd("mv %s/direnv-2.27.0 %s/src/%s/%s"
67 % (self.tmpdir_SDKQA, self.go_path, proj, name)) 67 % (self.tmpdir_SDKQA, self.go_path, proj, name))
68 retv = self.run_sdk_go_command('build %s/%s/cmd/dep' 68 retv = self.run_sdk_go_command('build', proj, name)
69 % (proj, name))
70 self.assertEqual(retv, 0, 69 self.assertEqual(retv, 0,
71 msg="Running go build failed for %s" % name) 70 msg="Running go build failed for %s" % name)