[PATCH 2/2 v4] efi: ESRT creation tests

Jose Marinho
2021-03-02T11:51:26Z

Hi Heinrich,

Thank you for your reviews.

>
> With which configuration do we see any entry in the list?
>
> I only got:
>
> => efidebug capsule esrt
> ========================================
> ESRT: fw_resource_count=0
> ESRT: fw_resource_count_max=0
> ESRT: fw_resource_version=1
> ========================================
> =>
>

To get the FIT and RAW capsules showing, the best is to execute the test script in:
test/py/tests/test_efi_capsule/test_capsule_firmware.py

> > diff --git a/test/lib/Makefile b/test/lib/Makefile index
> > 97c11e35a8..aeb8c13eb0 100644
> > --- a/test/lib/Makefile
> > +++ b/test/lib/Makefile
> > @@ -15,3 +15,4 @@ obj-$(CONFIG_UT_LIB_ASN1) += asn1.o
> > obj-$(CONFIG_UT_LIB_RSA) += rsa.o
> > obj-$(CONFIG_AES) += test_aes.o
> > obj-$(CONFIG_GETOPT) += getopt.o
> > +obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> > diff --git a/test/lib/efi_esrt.c b/test/lib/efi_esrt.c new file mode
> > 100644 index 0000000000..e8cfe671e2
> > --- /dev/null
> > +++ b/test/lib/efi_esrt.c
> > @@ -0,0 +1,191 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Test ESRT tables support
> > + *
> > + * Copyright (C) 2021 Arm Ltd.
> > + */
> > +#include <common.h>
> > +#include <efi_loader.h>
> > +#include <net.h>
> > +#include <test/lib.h>
> > +#include <test/test.h>
> > +#include <test/ut.h>
> > +
> > +#define TEST_ESRT_NUM_ENTRIES 255
> > +
> > +#if 0x100 < TEST_ESRT_NUM_ENTRIES
> > +#error TEST_ESRT_NUM_ENTRIES must be lower or equal to 255.
> > +#endif
>
> A comment above the #define should be enough.
>
> What leads to the limit of 255 entries?

The 255 entry limit stems from the get_image_info u8 descriptor_count output variable.
>
> Have the existing FMP protocols to be in the count?
>

Regards,

Jose