Skip to content

inconsistency with env attribute behavior #113

@Adnan-Elhammoudi

Description

@Adnan-Elhammoudi

Hi @Rahix

I am using the same code to fetch the environmental variables in U-boot using env
with two different boards one with U-Boot 2023.07.02 and U-Boot 2020.04 respectively.

code:

       filesize =  ub.env("filesize")
       output = ub.exec0("crc32", f"{fileaddr}" ,f"{filesize}")
       assert expected_crc in output

and I have noticed an inconsistency with the result

First board:

│   ├─[device-u-boot] printenv fileaddr
│   │    ## fileaddr=60000000
│   ├─[device-u-boot] printenv filesize
│   │    ## filesize=2c
│   ├─[device-u-boot] crc32 60000000 2c
│   │    ## crc32 for 60000000 ... 6000002b ==> e58cdcf0
PASSEDPOWEROFF (imx8q)

second board:

│   ├─[device-u-boot] printenv fileaddr
│   │    ## 
│   │    ## fileaddr=80280000
│   ├─[device-u-boot] printenv filesize
│   │    ## 
│   │    ## filesize=2c
│   ├─[device-u-boot] crc32 '=80280000␍' '=2c␍'
│   │    ## 
│   │    ## > '
│   │    ## crc32 for 00000000 ... ffffffffffffffff ==> 00000000
FAILEDPOWEROFF (imx8q)


================================================================= FAILURES =================================================================
____________________________________________________________ test_net_tftpboot _____________________________________________________________

    def test_net_tftpboot():
           .
           .
           .
            fileaddr =  ub.env("fileaddr")
            filesize =  ub.env("filesize")
            output = ub.exec0("crc32", f"{fileaddr}" ,f"{filesize}")
>           assert expected_crc in output
E           assert 'e58cdcf0' in "\n> '\r\ncrc32 for 00000000 ... ffffffffffffffff ="

test_cases/test_unetwork.py:141: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions