[PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test network for AST2700

Jamin Lin via posted 5 patches 5 months, 4 weeks ago
There is a newer version of this series
[PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test network for AST2700
Posted by Jamin Lin via 5 months, 4 weeks ago
Update a test case to test network connection via ssh and
changes to test Aspeed OpenBMC SDK v09.02 for AST2700.

ASPEED fixed TX mask issue from linux/drivers/ftgmac100.c.
It is required to use ASPEED SDK image since v09.02
for AST2700 QEMU network testing.

A test image is downloaded from the ASPEED Forked OpenBMC GitHub
release repository :
https://github.com/AspeedTech-BMC/openbmc/releases/

Test command:
```
cd build
pyvenv/bin/avocado run ../qemu/tests/avocado/machine_aspeed.py:AST2x00MachineSDK.test_aarch64_ast2700_evb_sdk_v09_02
```

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 tests/avocado/machine_aspeed.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index 3a20644fb2..855da805ae 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -313,14 +313,14 @@ def do_test_arm_aspeed_sdk_start(self, image):
 
     def do_test_aarch64_aspeed_sdk_start(self, image):
         self.vm.set_console()
-        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw')
+        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
+                         '-net', 'nic', '-net', 'user,hostfwd=:127.0.0.1:0-:22')
 
         self.vm.launch()
 
         self.wait_for_console_pattern('U-Boot 2023.10')
         self.wait_for_console_pattern('## Loading kernel from FIT Image')
         self.wait_for_console_pattern('Starting kernel ...')
-        self.wait_for_console_pattern("systemd[1]: Hostname set to")
 
     @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
 
@@ -387,15 +387,15 @@ def test_arm_ast2600_evb_sdk(self):
         year = time.strftime("%Y")
         self.ssh_command_output_contains('/sbin/hwclock -f /dev/rtc1', year);
 
-    def test_aarch64_ast2700_evb_sdk_v09_01(self):
+    def test_aarch64_ast2700_evb_sdk_v09_02(self):
         """
         :avocado: tags=arch:aarch64
         :avocado: tags=machine:ast2700-evb
         """
 
         image_url = ('https://github.com/AspeedTech-BMC/openbmc/releases/'
-                     'download/v09.01/ast2700-default-obmc.tar.gz')
-        image_hash = 'b1cc0fd73c7650d34c9c8459a243f52a91e9e27144b8608b2645ab19461d1e07'
+                     'download/v09.02/ast2700-default-obmc.tar.gz')
+        image_hash = 'ac969c2602f4e6bdb69562ff466b89ae3fe1d86e1f6797bb7969d787f82116a7'
         image_path = self.fetch_asset(image_url, asset_hash=image_hash,
                                       algorithm='sha256')
         archive.extract(image_path, self.workdir)
@@ -436,4 +436,5 @@ def test_aarch64_ast2700_evb_sdk_v09_01(self):
 
         self.vm.add_args('-smp', str(num_cpu))
         self.do_test_aarch64_aspeed_sdk_start(image_dir + 'image-bmc')
-
+        self.wait_for_console_pattern('nodistro.0 ast2700-default ttyS12')
+        self.ssh_connect('root', '0penBmc', False)
-- 
2.34.1
Re: [PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test network for AST2700
Posted by Cédric Le Goater 5 months, 4 weeks ago
On 7/3/24 10:16 AM, Jamin Lin wrote:
> Update a test case to test network connection via ssh and
> changes to test Aspeed OpenBMC SDK v09.02 for AST2700.
> 
> ASPEED fixed TX mask issue from linux/drivers/ftgmac100.c.
> It is required to use ASPEED SDK image since v09.02
> for AST2700 QEMU network testing.
> 
> A test image is downloaded from the ASPEED Forked OpenBMC GitHub
> release repository :
> https://github.com/AspeedTech-BMC/openbmc/releases/
> 
> Test command:
> ```
> cd build
> pyvenv/bin/avocado run ../qemu/tests/avocado/machine_aspeed.py:AST2x00MachineSDK.test_aarch64_ast2700_evb_sdk_v09_02
> ```
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>

Could you please split the patch ? The change of SDK should be
a standalone patch.


Thanks,

C.


> ---
>   tests/avocado/machine_aspeed.py | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
> index 3a20644fb2..855da805ae 100644
> --- a/tests/avocado/machine_aspeed.py
> +++ b/tests/avocado/machine_aspeed.py
> @@ -313,14 +313,14 @@ def do_test_arm_aspeed_sdk_start(self, image):
>   
>       def do_test_aarch64_aspeed_sdk_start(self, image):
>           self.vm.set_console()
> -        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw')
> +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
> +                         '-net', 'nic', '-net', 'user,hostfwd=:127.0.0.1:0-:22')
>   
>           self.vm.launch()
>   
>           self.wait_for_console_pattern('U-Boot 2023.10')
>           self.wait_for_console_pattern('## Loading kernel from FIT Image')
>           self.wait_for_console_pattern('Starting kernel ...')
> -        self.wait_for_console_pattern("systemd[1]: Hostname set to")
>   
>       @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
>   
> @@ -387,15 +387,15 @@ def test_arm_ast2600_evb_sdk(self):
>           year = time.strftime("%Y")
>           self.ssh_command_output_contains('/sbin/hwclock -f /dev/rtc1', year);
>   
> -    def test_aarch64_ast2700_evb_sdk_v09_01(self):
> +    def test_aarch64_ast2700_evb_sdk_v09_02(self):
>           """
>           :avocado: tags=arch:aarch64
>           :avocado: tags=machine:ast2700-evb
>           """
>   
>           image_url = ('https://github.com/AspeedTech-BMC/openbmc/releases/'
> -                     'download/v09.01/ast2700-default-obmc.tar.gz')
> -        image_hash = 'b1cc0fd73c7650d34c9c8459a243f52a91e9e27144b8608b2645ab19461d1e07'
> +                     'download/v09.02/ast2700-default-obmc.tar.gz')
> +        image_hash = 'ac969c2602f4e6bdb69562ff466b89ae3fe1d86e1f6797bb7969d787f82116a7'
>           image_path = self.fetch_asset(image_url, asset_hash=image_hash,
>                                         algorithm='sha256')
>           archive.extract(image_path, self.workdir)
> @@ -436,4 +436,5 @@ def test_aarch64_ast2700_evb_sdk_v09_01(self):
>   
>           self.vm.add_args('-smp', str(num_cpu))
>           self.do_test_aarch64_aspeed_sdk_start(image_dir + 'image-bmc')
> -
> +        self.wait_for_console_pattern('nodistro.0 ast2700-default ttyS12')
> +        self.ssh_connect('root', '0penBmc', False)
RE: [PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test network for AST2700
Posted by Jamin Lin 5 months, 4 weeks ago
> -----Original Message-----
> From: Cédric Le Goater <clg@kaod.org>
> Sent: Wednesday, July 3, 2024 5:18 PM
> To: Jamin Lin <jamin_lin@aspeedtech.com>; Peter Maydell
> <peter.maydell@linaro.org>; Steven Lee <steven_lee@aspeedtech.com>; Troy
> Lee <leetroy@gmail.com>; Andrew Jeffery <andrew@codeconstruct.com.au>;
> Joel Stanley <joel@jms.id.au>; Alistair Francis <alistair@alistair23.me>; Kevin
> Wolf <kwolf@redhat.com>; Hanna Reitz <hreitz@redhat.com>; Jason Wang
> <jasowang@redhat.com>; Cleber Rosa <crosa@redhat.com>; Philippe
> Mathieu-Daudé <philmd@linaro.org>; Wainer dos Santos Moschetta
> <wainersm@redhat.com>; Beraldo Leal <bleal@redhat.com>; open list:ASPEED
> BMCs <qemu-arm@nongnu.org>; open list:All patches CC here
> <qemu-devel@nongnu.org>; open list:Block layer core
> <qemu-block@nongnu.org>
> Cc: Troy Lee <troy_lee@aspeedtech.com>; Yunlin Tang
> <yunlin.tang@aspeedtech.com>
> Subject: Re: [PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test
> network for AST2700
> 
> On 7/3/24 10:16 AM, Jamin Lin wrote:
> > Update a test case to test network connection via ssh and changes to
> > test Aspeed OpenBMC SDK v09.02 for AST2700.
> >
> > ASPEED fixed TX mask issue from linux/drivers/ftgmac100.c.
> > It is required to use ASPEED SDK image since v09.02 for AST2700 QEMU
> > network testing.
> >
> > A test image is downloaded from the ASPEED Forked OpenBMC GitHub
> > release repository :
> > https://github.com/AspeedTech-BMC/openbmc/releases/
> >
> > Test command:
> > ```
> > cd build
> > pyvenv/bin/avocado run
> > ../qemu/tests/avocado/machine_aspeed.py:AST2x00MachineSDK.test_aarch
> 64
> > _ast2700_evb_sdk_v09_02
> > ```
> >
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> 
> Could you please split the patch ? The change of SDK should be a standalone
> patch.
> 
Will fix
Thanks-Jamin
> 
> Thanks,
> 
> C.
> 
> 
> > ---
> >   tests/avocado/machine_aspeed.py | 13 +++++++------
> >   1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/avocado/machine_aspeed.py
> > b/tests/avocado/machine_aspeed.py index 3a20644fb2..855da805ae 100644
> > --- a/tests/avocado/machine_aspeed.py
> > +++ b/tests/avocado/machine_aspeed.py
> > @@ -313,14 +313,14 @@ def do_test_arm_aspeed_sdk_start(self, image):
> >
> >       def do_test_aarch64_aspeed_sdk_start(self, image):
> >           self.vm.set_console()
> > -        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw')
> > +        self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
> > +                         '-net', 'nic', '-net',
> > + 'user,hostfwd=:127.0.0.1:0-:22')
> >
> >           self.vm.launch()
> >
> >           self.wait_for_console_pattern('U-Boot 2023.10')
> >           self.wait_for_console_pattern('## Loading kernel from FIT
> Image')
> >           self.wait_for_console_pattern('Starting kernel ...')
> > -        self.wait_for_console_pattern("systemd[1]: Hostname set to")
> >
> >       @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is
> > unstable on GitLab')
> >
> > @@ -387,15 +387,15 @@ def test_arm_ast2600_evb_sdk(self):
> >           year = time.strftime("%Y")
> >           self.ssh_command_output_contains('/sbin/hwclock -f
> > /dev/rtc1', year);
> >
> > -    def test_aarch64_ast2700_evb_sdk_v09_01(self):
> > +    def test_aarch64_ast2700_evb_sdk_v09_02(self):
> >           """
> >           :avocado: tags=arch:aarch64
> >           :avocado: tags=machine:ast2700-evb
> >           """
> >
> >           image_url =
> ('https://github.com/AspeedTech-BMC/openbmc/releases/'
> > -                     'download/v09.01/ast2700-default-obmc.tar.gz')
> > -        image_hash =
> 'b1cc0fd73c7650d34c9c8459a243f52a91e9e27144b8608b2645ab19461d1e07'
> > +                     'download/v09.02/ast2700-default-obmc.tar.gz')
> > +        image_hash =
> 'ac969c2602f4e6bdb69562ff466b89ae3fe1d86e1f6797bb7969d787f82116a7'
> >           image_path = self.fetch_asset(image_url,
> asset_hash=image_hash,
> >                                         algorithm='sha256')
> >           archive.extract(image_path, self.workdir) @@ -436,4 +436,5
> > @@ def test_aarch64_ast2700_evb_sdk_v09_01(self):
> >
> >           self.vm.add_args('-smp', str(num_cpu))
> >           self.do_test_aarch64_aspeed_sdk_start(image_dir +
> > 'image-bmc')
> > -
> > +        self.wait_for_console_pattern('nodistro.0 ast2700-default ttyS12')
> > +        self.ssh_connect('root', '0penBmc', False)