mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 17:07:38 +00:00
binman: Don't change the descriptor in tests
At present testPackX86RomMeNoDesc removes the contents of the descriptor.bin file and testPackX86RomMeMissingDesc removes the file completely. If a test that relies on this file happens to run after it is removed, it will not work. Since we have no control over the selecting of tests that run in parallel and series, we must avoid changing the files. Update this tests to use separate files instead. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
2548493ab4
commit
52b10dd7de
3 changed files with 47 additions and 5 deletions
|
@ -940,9 +940,9 @@ class TestFunctional(unittest.TestCase):
|
||||||
def testPackX86RomMeNoDesc(self):
|
def testPackX86RomMeNoDesc(self):
|
||||||
"""Test that an invalid Intel descriptor entry is detected"""
|
"""Test that an invalid Intel descriptor entry is detected"""
|
||||||
try:
|
try:
|
||||||
TestFunctional._MakeInputFile('descriptor.bin', b'')
|
TestFunctional._MakeInputFile('descriptor-empty.bin', b'')
|
||||||
with self.assertRaises(ValueError) as e:
|
with self.assertRaises(ValueError) as e:
|
||||||
self._DoTestFile('031_x86_rom_me.dts')
|
self._DoTestFile('163_x86_rom_me_empty.dts')
|
||||||
self.assertIn("Node '/binman/intel-descriptor': Cannot find Intel Flash Descriptor (FD) signature",
|
self.assertIn("Node '/binman/intel-descriptor': Cannot find Intel Flash Descriptor (FD) signature",
|
||||||
str(e.exception))
|
str(e.exception))
|
||||||
finally:
|
finally:
|
||||||
|
@ -3405,10 +3405,8 @@ class TestFunctional(unittest.TestCase):
|
||||||
|
|
||||||
def testPackX86RomMeMissingDesc(self):
|
def testPackX86RomMeMissingDesc(self):
|
||||||
"""Test that an missing Intel descriptor entry is allowed"""
|
"""Test that an missing Intel descriptor entry is allowed"""
|
||||||
pathname = os.path.join(self._indir, 'descriptor.bin')
|
|
||||||
os.remove(pathname)
|
|
||||||
with test_util.capture_sys_output() as (stdout, stderr):
|
with test_util.capture_sys_output() as (stdout, stderr):
|
||||||
self._DoTestFile('031_x86_rom_me.dts', allow_missing=True)
|
self._DoTestFile('164_x86_rom_me_missing.dts', allow_missing=True)
|
||||||
err = stderr.getvalue()
|
err = stderr.getvalue()
|
||||||
self.assertRegex(err,
|
self.assertRegex(err,
|
||||||
"Image 'main-section'.*missing.*: intel-descriptor")
|
"Image 'main-section'.*missing.*: intel-descriptor")
|
||||||
|
|
22
tools/binman/test/163_x86_rom_me_empty.dts
Normal file
22
tools/binman/test/163_x86_rom_me_empty.dts
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
/ {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
binman {
|
||||||
|
sort-by-offset;
|
||||||
|
end-at-4gb;
|
||||||
|
size = <0x800000>;
|
||||||
|
intel-descriptor {
|
||||||
|
filename = "descriptor-empty.bin";
|
||||||
|
};
|
||||||
|
|
||||||
|
intel-me {
|
||||||
|
filename = "me.bin";
|
||||||
|
offset-unset;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
22
tools/binman/test/164_x86_rom_me_missing.dts
Normal file
22
tools/binman/test/164_x86_rom_me_missing.dts
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
/ {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
binman {
|
||||||
|
sort-by-offset;
|
||||||
|
end-at-4gb;
|
||||||
|
size = <0x800000>;
|
||||||
|
intel-descriptor {
|
||||||
|
filename = "descriptor-missing.bin";
|
||||||
|
};
|
||||||
|
|
||||||
|
intel-me {
|
||||||
|
filename = "me.bin";
|
||||||
|
offset-unset;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in a new issue