vbe: Use a manual test
Use a manual test for the VBE test, so we can make the pytest and the C unit test work together properly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5981d61178
commit
2a5c67f50a
@ -13,21 +13,18 @@
|
|||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
#include "bootstd_common.h"
|
#include "bootstd_common.h"
|
||||||
|
|
||||||
/* Basic test of reading nvdata and updating a fwupd node in the device tree */
|
/*
|
||||||
static int vbe_test_fixup(struct unit_test_state *uts)
|
* Basic test of reading nvdata and updating a fwupd node in the device tree
|
||||||
|
* This test works when called from test_vbe.py and it must use the flat tree,
|
||||||
|
* since device tree fix-ups do not yet support live tree.
|
||||||
|
*/
|
||||||
|
static int vbe_test_fixup_norun(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
ofnode chosen, node;
|
ofnode chosen, node;
|
||||||
const char *data;
|
const char *data;
|
||||||
oftree tree;
|
oftree tree;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
/*
|
|
||||||
* This test works when called from test_vbe.py and it must use the
|
|
||||||
* flat tree, since device tree fix-ups do not yet support live tree.
|
|
||||||
*/
|
|
||||||
if (!working_fdt)
|
|
||||||
return -EAGAIN;
|
|
||||||
|
|
||||||
tree = oftree_from_fdt(working_fdt);
|
tree = oftree_from_fdt(working_fdt);
|
||||||
ut_assert(oftree_valid(tree));
|
ut_assert(oftree_valid(tree));
|
||||||
|
|
||||||
@ -55,5 +52,5 @@ static int vbe_test_fixup(struct unit_test_state *uts)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
BOOTSTD_TEST(vbe_test_fixup,
|
BOOTSTD_TEST(vbe_test_fixup_norun, UT_TESTF_DM | UT_TESTF_SCAN_FDT |
|
||||||
UT_TESTF_DM | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
|
UT_TESTF_FLAT_TREE | UT_TESTF_MANUAL);
|
||||||
|
@ -85,7 +85,7 @@ bootm loados
|
|||||||
bootm prep
|
bootm prep
|
||||||
fdt addr
|
fdt addr
|
||||||
fdt print
|
fdt print
|
||||||
ut bootstd vbe_test_fixup
|
ut bootstd -f vbe_test_fixup_norun
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@pytest.mark.boardspec('sandbox_flattree')
|
@pytest.mark.boardspec('sandbox_flattree')
|
||||||
@ -117,7 +117,4 @@ def test_vbe(u_boot_console):
|
|||||||
with cons.log.section('Kernel load'):
|
with cons.log.section('Kernel load'):
|
||||||
output = cons.run_command_list(cmd.splitlines())
|
output = cons.run_command_list(cmd.splitlines())
|
||||||
|
|
||||||
# This is a little wonky since there are two tests running in CI. The final
|
assert 'Failures: 0' in output[-1]
|
||||||
# one is the 'ut bootstd' command above
|
|
||||||
failures = [line for line in output if 'Failures' in line]
|
|
||||||
assert len(failures) >= 1 and 'Failures: 0' in failures[-1]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user