diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/logrotate.py | 31 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/cases/autotools.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bblayers.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/buildoptions.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/rust.py | 5 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py | 4 |
6 files changed, 26 insertions, 24 deletions
diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py index 7cb43d98c5..0d4b9ac60b 100644 --- a/meta/lib/oeqa/runtime/cases/logrotate.py +++ b/meta/lib/oeqa/runtime/cases/logrotate.py | |||
@@ -20,55 +20,56 @@ class LogrotateTest(OERuntimeTestCase): | |||
20 | 20 | ||
21 | @classmethod | 21 | @classmethod |
22 | def tearDownClass(cls): | 22 | def tearDownClass(cls): |
23 | cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir', ignore_ssh_fails=True) | 23 | cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log/logrotate_dir', ignore_ssh_fails=True) |
24 | cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True) | 24 | cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True) |
25 | 25 | ||
26 | @OETestDepends(['ssh.SSHTest.test_ssh']) | 26 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
27 | @OEHasPackage(['logrotate']) | 27 | @OEHasPackage(['logrotate']) |
28 | def test_logrotate_wtmp(self): | 28 | def test_logrotate_wtmp(self): |
29 | |||
30 | # /var/log/wtmp may not always exist initially, so use touch to ensure it is present | 29 | # /var/log/wtmp may not always exist initially, so use touch to ensure it is present |
31 | status, output = self.target.run('touch /var/log/wtmp') | 30 | status, output = self.target.run('touch /var/log/wtmp') |
32 | msg = ('Could not create/update /var/log/wtmp with touch') | 31 | msg = ('Could not create/update /var/log/wtmp with touch') |
33 | self.assertEqual(status, 0, msg = msg) | 32 | self.assertEqual(status, 0, msg = msg) |
34 | 33 | ||
35 | status, output = self.target.run('mkdir /var/log//logrotate_dir') | 34 | # Create a folder to store rotated file and add the corresponding |
35 | # configuration option | ||
36 | status, output = self.target.run('mkdir /var/log/logrotate_dir') | ||
36 | msg = ('Could not create logrotate_dir. Output: %s' % output) | 37 | msg = ('Could not create logrotate_dir. Output: %s' % output) |
37 | self.assertEqual(status, 0, msg = msg) | 38 | self.assertEqual(status, 0, msg = msg) |
38 | 39 | ||
39 | status, output = self.target.run('echo "create \n olddir /var/log//logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') | 40 | status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') |
40 | msg = ('Could not write to /tmp/logrotate-test.conf') | 41 | msg = ('Could not write to /tmp/logrotate-test.conf') |
41 | self.assertEqual(status, 0, msg = msg) | 42 | self.assertEqual(status, 0, msg = msg) |
42 | 43 | ||
44 | # Call logrotate -f to force the rotation immediately | ||
43 | # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it | 45 | # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it |
44 | _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') | 46 | _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') |
45 | status, _ = self.target.run('find /var/log//logrotate_dir -type f | grep wtmp.1') | 47 | status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep wtmp.1') |
46 | msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) | 48 | msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) |
47 | self.assertEqual(status, 0, msg = msg) | 49 | self.assertEqual(status, 0, msg = msg) |
48 | 50 | ||
49 | @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) | 51 | @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) |
50 | def test_logrotate_newlog(self): | 52 | def test_logrotate_newlog(self): |
51 | |||
52 | status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') | 53 | status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') |
53 | msg = ('Could not create logrotate test file in /var/log') | 54 | msg = ('Could not create logrotate test file in /var/log') |
54 | self.assertEqual(status, 0, msg = msg) | 55 | self.assertEqual(status, 0, msg = msg) |
55 | 56 | ||
56 | status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1" > /etc/logrotate.d/logrotate_testfile') | 57 | # Create a new configuration file dedicated to a /var/log/logrotate_testfile |
58 | status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1}" > /etc/logrotate.d/logrotate_testfile') | ||
57 | msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') | 59 | msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') |
58 | self.assertEqual(status, 0, msg = msg) | 60 | self.assertEqual(status, 0, msg = msg) |
59 | 61 | ||
60 | status, output = self.target.run('echo "create \n olddir /var/log//logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') | 62 | status, output = self.target.run('echo "create \n olddir /var/log/logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') |
61 | msg = ('Could not write to /tmp/logrotate_test2.conf') | 63 | msg = ('Could not write to /tmp/logrotate_test2.conf') |
62 | self.assertEqual(status, 0, msg = msg) | 64 | self.assertEqual(status, 0, msg = msg) |
63 | 65 | ||
64 | status, output = self.target.run('find /var/log//logrotate_dir -type f | grep logrotate_testfile.1') | 66 | status, output = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') |
65 | msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') | 67 | msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') |
66 | self.assertEqual(status, 1, msg = msg) | 68 | self.assertEqual(status, 1, msg = msg) |
67 | 69 | ||
70 | # Call logrotate -f to force the rotation immediately | ||
68 | # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir | 71 | # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir |
69 | _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') | 72 | _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') |
70 | status, _ = self.target.run('find /var/log//logrotate_dir -type f | grep logrotate_testfile.1') | 73 | status, _ = self.target.run('find /var/log/logrotate_dir -type f | grep logrotate_testfile.1') |
71 | msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) | 74 | msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) |
72 | self.assertEqual(status, 0, msg = msg) | 75 | self.assertEqual(status, 0, msg = msg) |
73 | |||
74 | |||
diff --git a/meta/lib/oeqa/sdk/cases/autotools.py b/meta/lib/oeqa/sdk/cases/autotools.py index 3f51854e3d..ecafafa7d6 100644 --- a/meta/lib/oeqa/sdk/cases/autotools.py +++ b/meta/lib/oeqa/sdk/cases/autotools.py | |||
@@ -27,7 +27,7 @@ class AutotoolsTest(OESDKTestCase): | |||
27 | pmv = parallel_make_value((self.td.get('PARALLEL_MAKE') or '').split()) | 27 | pmv = parallel_make_value((self.td.get('PARALLEL_MAKE') or '').split()) |
28 | 28 | ||
29 | with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: | 29 | with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: |
30 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz") | 30 | tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftpmirror.gnu.org/gnu/cpio/cpio-2.15.tar.gz") |
31 | 31 | ||
32 | opts = {} | 32 | opts = {} |
33 | opts["source"] = os.path.join(testdir, "cpio-2.15") | 33 | opts["source"] = os.path.join(testdir, "cpio-2.15") |
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 8026e7ed4a..982287c9a5 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
@@ -157,11 +157,11 @@ class BitbakeLayers(OESelftestTestCase): | |||
157 | with open(jsonfile) as f: | 157 | with open(jsonfile) as f: |
158 | data = json.load(f) | 158 | data = json.load(f) |
159 | for s in data['sources']: | 159 | for s in data['sources']: |
160 | if s == 'poky': | 160 | if s == 'poky' or s == 'build': |
161 | data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0' | 161 | data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0' |
162 | elif s == 'meta-yocto': | 162 | elif s == 'meta-yocto': |
163 | data['sources'][s]['git-remote']['rev'] = '913bd8ba4dd1d5d2a38261bde985b64a36e36281' | 163 | data['sources'][s]['git-remote']['rev'] = '913bd8ba4dd1d5d2a38261bde985b64a36e36281' |
164 | else: | 164 | elif s == 'openembedded-core': |
165 | data['sources'][s]['git-remote']['rev'] = '744a2277844ec9a384a9ca7dae2a634d5a0d3590' | 165 | data['sources'][s]['git-remote']['rev'] = '744a2277844ec9a384a9ca7dae2a634d5a0d3590' |
166 | with open(jsonfile, 'w') as f: | 166 | with open(jsonfile, 'w') as f: |
167 | json.dump(data, f) | 167 | json.dump(data, f) |
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py index 767e19bd88..b46f55e256 100644 --- a/meta/lib/oeqa/selftest/cases/buildoptions.py +++ b/meta/lib/oeqa/selftest/cases/buildoptions.py | |||
@@ -173,11 +173,11 @@ class SourceMirroring(OESelftestTestCase): | |||
173 | def test_yocto_source_mirror(self): | 173 | def test_yocto_source_mirror(self): |
174 | self.write_config(""" | 174 | self.write_config(""" |
175 | BB_ALLOWED_NETWORKS = "downloads.yoctoproject.org" | 175 | BB_ALLOWED_NETWORKS = "downloads.yoctoproject.org" |
176 | MIRRORS = "" | 176 | MIRRORS:forcevariable = "" |
177 | DL_DIR = "${TMPDIR}/test_downloads" | 177 | DL_DIR = "${TMPDIR}/test_downloads" |
178 | STAMPS_DIR = "${TMPDIR}/test_stamps" | 178 | STAMPS_DIR = "${TMPDIR}/test_stamps" |
179 | SSTATE_DIR = "${TMPDIR}/test_sstate-cache" | 179 | SSTATE_DIR = "${TMPDIR}/test_sstate-cache" |
180 | PREMIRRORS = "\\ | 180 | PREMIRRORS:forcevariable = "\\ |
181 | bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ | 181 | bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ |
182 | cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ | 182 | cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ |
183 | git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ | 183 | git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \\n \\ |
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 95859a9eef..06acf53e9a 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py | |||
@@ -102,8 +102,9 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | |||
102 | testargs = exclude_fail_tests + " --no-doc --no-fail-fast --bless" | 102 | testargs = exclude_fail_tests + " --no-doc --no-fail-fast --bless" |
103 | 103 | ||
104 | # wrap the execution with a qemu instance. | 104 | # wrap the execution with a qemu instance. |
105 | # Tests are run with 512 tasks in parallel to execute all tests very quickly | 105 | # Set QEMU RAM to 1024MB to support running unit tests for the compiler crate, including larger |
106 | with runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams = "-m 512") as qemu: | 106 | # test cases and parallel execution in the test environment. |
107 | with runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams = "-m 1024") as qemu: | ||
107 | # Copy remote-test-server to image through scp | 108 | # Copy remote-test-server to image through scp |
108 | host_sys = get_bb_var("RUST_BUILD_SYS", "rust") | 109 | host_sys = get_bb_var("RUST_BUILD_SYS", "rust") |
109 | ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root") | 110 | ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root") |
diff --git a/meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py b/meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py index 312edb6431..b1015d60ef 100644 --- a/meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py +++ b/meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py | |||
@@ -18,8 +18,8 @@ sys.path = sys.path + [lib_path] | |||
18 | class TestResultsQueryTests(OESelftestTestCase): | 18 | class TestResultsQueryTests(OESelftestTestCase): |
19 | def test_get_sha1(self): | 19 | def test_get_sha1(self): |
20 | test_data_get_sha1 = [ | 20 | test_data_get_sha1 = [ |
21 | {"input": "yocto-4.0", "expected": "00cfdde791a0176c134f31e5a09eff725e75b905"}, | 21 | {"input": "yocto-4.0", "expected": "92fcb6570bddd0c5717d8cfdf38ecf3e44942b0f"}, |
22 | {"input": "4.1_M1", "expected": "95066dde6861ee08fdb505ab3e0422156cc24fae"}, | 22 | {"input": "yocto-5.2", "expected": "6ec2c52b938302b894f119f701ffcf0a847eee85"}, |
23 | ] | 23 | ] |
24 | for data in test_data_get_sha1: | 24 | for data in test_data_get_sha1: |
25 | test_name = data["input"] | 25 | test_name = data["input"] |