diff mbox series

[40/40] lmb: ut: re-enable unit tests

Message ID 20240724060224.3071065-41-sughosh.ganu@linaro.org
State Superseded
Headers show
Series Make LMB memory map global and persistent | expand

Commit Message

Sughosh Ganu July 24, 2024, 6:02 a.m. UTC
All the changes needed for making the LMB memory map persistent and
global have been made, including making corresponding changes in the
test code. Re-enable the unit tests on the platforms.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since rfc: New patch

 configs/sandbox64_defconfig        | 4 +++-
 configs/sandbox_defconfig          | 7 +++----
 configs/sandbox_flattree_defconfig | 4 +++-
 configs/sandbox_noinst_defconfig   | 8 ++++----
 configs/sandbox_spl_defconfig      | 8 ++++----
 configs/sandbox_vpl_defconfig      | 6 ++++--
 configs/snow_defconfig             | 2 +-
 7 files changed, 22 insertions(+), 17 deletions(-)

Comments

Simon Glass July 25, 2024, 11:32 p.m. UTC | #1
Hi Sughosh,

On Wed, 24 Jul 2024 at 00:06, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> All the changes needed for making the LMB memory map persistent and
> global have been made, including making corresponding changes in the
> test code. Re-enable the unit tests on the platforms.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since rfc: New patch
>
>  configs/sandbox64_defconfig        | 4 +++-
>  configs/sandbox_defconfig          | 7 +++----
>  configs/sandbox_flattree_defconfig | 4 +++-
>  configs/sandbox_noinst_defconfig   | 8 ++++----
>  configs/sandbox_spl_defconfig      | 8 ++++----
>  configs/sandbox_vpl_defconfig      | 6 ++++--
>  configs/snow_defconfig             | 2 +-
>  7 files changed, 22 insertions(+), 17 deletions(-)

It would be much better to change the tests as needed, so they keep passing.

Regards,
Simon
Sughosh Ganu July 29, 2024, 8:58 a.m. UTC | #2
On Fri, 26 Jul 2024 at 05:03, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Sughosh,
>
> On Wed, 24 Jul 2024 at 00:06, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> >
> > All the changes needed for making the LMB memory map persistent and
> > global have been made, including making corresponding changes in the
> > test code. Re-enable the unit tests on the platforms.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > ---
> > Changes since rfc: New patch
> >
> >  configs/sandbox64_defconfig        | 4 +++-
> >  configs/sandbox_defconfig          | 7 +++----
> >  configs/sandbox_flattree_defconfig | 4 +++-
> >  configs/sandbox_noinst_defconfig   | 8 ++++----
> >  configs/sandbox_spl_defconfig      | 8 ++++----
> >  configs/sandbox_vpl_defconfig      | 6 ++++--
> >  configs/snow_defconfig             | 2 +-
> >  7 files changed, 22 insertions(+), 17 deletions(-)
>
> It would be much better to change the tests as needed, so they keep passing.

What issue do you see with this approach? If I have to do what you
suggest, I will have to put all the test related changes as part of
the same commit which makes the LMB map persistent and global. I have
seen this kind of approach taken elsewhere, so really not sure what is
the problem with this.

-sughosh

>
> Regards,
> Simon
Simon Glass July 29, 2024, 3:28 p.m. UTC | #3
Hi Sughosh,

On Mon, 29 Jul 2024 at 02:58, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> On Fri, 26 Jul 2024 at 05:03, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Sughosh,
> >
> > On Wed, 24 Jul 2024 at 00:06, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> > >
> > > All the changes needed for making the LMB memory map persistent and
> > > global have been made, including making corresponding changes in the
> > > test code. Re-enable the unit tests on the platforms.
> > >
> > > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > > ---
> > > Changes since rfc: New patch
> > >
> > >  configs/sandbox64_defconfig        | 4 +++-
> > >  configs/sandbox_defconfig          | 7 +++----
> > >  configs/sandbox_flattree_defconfig | 4 +++-
> > >  configs/sandbox_noinst_defconfig   | 8 ++++----
> > >  configs/sandbox_spl_defconfig      | 8 ++++----
> > >  configs/sandbox_vpl_defconfig      | 6 ++++--
> > >  configs/snow_defconfig             | 2 +-
> > >  7 files changed, 22 insertions(+), 17 deletions(-)
> >
> > It would be much better to change the tests as needed, so they keep passing.
>
> What issue do you see with this approach? If I have to do what you
> suggest, I will have to put all the test related changes as part of
> the same commit which makes the LMB map persistent and global. I have
> seen this kind of approach taken elsewhere, so really not sure what is
> the problem with this.

Yes, normally when code changes the tests change too, otherwise the
tests are broken on that commit. Disabling them doesn't resolve that.

Once you figure out the save/restore thing you will find the tests
quite easy. I think part of the problem is that you are making the lmb
tests 'special'.

Regards,
Simon
diff mbox series

Patch

diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
index dbcf65d29f..dd0582d2a0 100644
--- a/configs/sandbox64_defconfig
+++ b/configs/sandbox64_defconfig
@@ -3,7 +3,6 @@  CONFIG_SYS_MALLOC_LEN=0x6000000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="sandbox64"
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_PRE_CON_BUF_ADDR=0x100000
 CONFIG_SYS_LOAD_ADDR=0x0
@@ -271,3 +270,6 @@  CONFIG_GETOPT=y
 CONFIG_EFI_RT_VOLATILE_STORE=y
 CONFIG_EFI_SECURE_BOOT=y
 CONFIG_TEST_FDTDEC=y
+CONFIG_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 9bb1813e77..dc5fcdbd1c 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -3,7 +3,6 @@  CONFIG_SYS_MALLOC_LEN=0x6000000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_PRE_CON_BUF_ADDR=0xf0000
 CONFIG_SYS_LOAD_ADDR=0x0
@@ -346,9 +345,6 @@  CONFIG_ADDR_MAP=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ECDSA=y
 CONFIG_ECDSA_VERIFY=y
-CONFIG_CRYPT_PW=y
-CONFIG_CRYPT_PW_SHA256=y
-CONFIG_CRYPT_PW_SHA512=y
 CONFIG_TPM=y
 CONFIG_ERRNO_STR=y
 CONFIG_GETOPT=y
@@ -360,3 +356,6 @@  CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_CRT_FILE="board/sandbox/capsule_pub_key_good.crt"
 CONFIG_EFI_SECURE_BOOT=y
 CONFIG_TEST_FDTDEC=y
+CONFIG_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig
index b87bd145bb..049a606613 100644
--- a/configs/sandbox_flattree_defconfig
+++ b/configs/sandbox_flattree_defconfig
@@ -2,7 +2,6 @@  CONFIG_TEXT_BASE=0
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SYS_LOAD_ADDR=0x0
 CONFIG_PCI=y
@@ -229,3 +228,6 @@  CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
 CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_CRT_FILE="board/sandbox/capsule_pub_key_good.crt"
+CONFIG_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/sandbox_noinst_defconfig b/configs/sandbox_noinst_defconfig
index 6150f55072..e930162937 100644
--- a/configs/sandbox_noinst_defconfig
+++ b/configs/sandbox_noinst_defconfig
@@ -6,7 +6,6 @@  CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_SPL_DM_SPI=y
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
@@ -132,7 +131,6 @@  CONFIG_NETCONSOLE=y
 CONFIG_IP_DEFRAG=y
 CONFIG_BOOTP_SERVERIP=y
 CONFIG_SPL_DM=y
-CONFIG_SPL_DM_DEVICE_REMOVE=y
 CONFIG_DM_DMA=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
@@ -279,10 +277,12 @@  CONFIG_FS_CRAMFS=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_RSA_VERIFY_WITH_PKEY=y
-CONFIG_X509_CERTIFICATE_PARSER=y
-CONFIG_PKCS7_MESSAGE_PARSER=y
 CONFIG_TPM=y
 CONFIG_ZSTD=y
 CONFIG_SPL_LZMA=y
 CONFIG_ERRNO_STR=y
 CONFIG_SPL_LMB=y
+CONFIG_UNIT_TEST=y
+CONFIG_SPL_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 3dd4c7ab43..31ccdbd502 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -5,7 +5,6 @@  CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
@@ -108,7 +107,6 @@  CONFIG_NETCONSOLE=y
 CONFIG_IP_DEFRAG=y
 CONFIG_BOOTP_SERVERIP=y
 CONFIG_SPL_DM=y
-CONFIG_SPL_DM_DEVICE_REMOVE=y
 CONFIG_DM_DMA=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
@@ -245,8 +243,6 @@  CONFIG_FS_CRAMFS=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_RSA_VERIFY_WITH_PKEY=y
-CONFIG_X509_CERTIFICATE_PARSER=y
-CONFIG_PKCS7_MESSAGE_PARSER=y
 CONFIG_TPM=y
 CONFIG_SPL_CRC8=y
 CONFIG_ZSTD=y
@@ -254,3 +250,7 @@  CONFIG_SPL_LZMA=y
 CONFIG_ERRNO_STR=y
 CONFIG_SPL_HEXDUMP=y
 CONFIG_SPL_LMB=y
+CONFIG_UNIT_TEST=y
+CONFIG_SPL_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig
index a8e9e16746..3ec64fd982 100644
--- a/configs/sandbox_vpl_defconfig
+++ b/configs/sandbox_vpl_defconfig
@@ -5,7 +5,6 @@  CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="sandbox"
 CONFIG_SPL_TEXT_BASE=0x100000
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
@@ -119,7 +118,6 @@  CONFIG_NETCONSOLE=y
 CONFIG_IP_DEFRAG=y
 CONFIG_SPL_DM=y
 CONFIG_TPL_DM=y
-CONFIG_SPL_DM_DEVICE_REMOVE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DM_DMA=y
 CONFIG_REGMAP=y
@@ -254,3 +252,7 @@  CONFIG_TPM=y
 CONFIG_ZSTD=y
 # CONFIG_VPL_LZMA is not set
 CONFIG_ERRNO_STR=y
+CONFIG_UNIT_TEST=y
+CONFIG_SPL_UNIT_TEST=y
+CONFIG_UT_TIME=y
+CONFIG_UT_DM=y
diff --git a/configs/snow_defconfig b/configs/snow_defconfig
index 637c51d2c2..2c0757194b 100644
--- a/configs/snow_defconfig
+++ b/configs/snow_defconfig
@@ -19,7 +19,6 @@  CONFIG_ENV_OFFSET=0x3FC000
 CONFIG_ENV_SECT_SIZE=0x4000
 CONFIG_DEFAULT_DEVICE_TREE="exynos5250-snow"
 CONFIG_SPL_TEXT_BASE=0x02023400
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0x12c30000
 CONFIG_DEBUG_UART_CLOCK=100000000
@@ -108,3 +107,4 @@  CONFIG_VIDEO_BRIDGE_PARADE_PS862X=y
 CONFIG_VIDEO_BRIDGE_NXP_PTN3460=y
 CONFIG_TPM=y
 CONFIG_ERRNO_STR=y
+CONFIG_UNIT_TEST=y