* [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-10 17:50 ` Chih-Min Chao
0 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-10 17:50 UTC (permalink / raw)
To: qemu-devel, qemu-riscv
Cc: Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé,
Chih-Min Chao, Cleber Rosa, Caio Carrara
Similar to the mips + malta test, it boots a Linux kernel on a virt
board and verify the serial is working. Also, it relies on the serial
device set by the machine itself.
If riscv64 is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:riscv64" tags.
Alternatively, this test can be run using:
$ avocado run -t arch:riscv64 tests/acceptance
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
---
tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3215950..bbc6b06 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
self.vm.launch()
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)
+
+ def test_riscv64_virt(self):
+ """
+ :avocado: tags=arch:riscv64
+ :avocado: tags=machine:virt
+ """
+
+ kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
+ '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
+ 'bbl_w_kernel.gz')
+ kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
+ kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+ kernel_path = self.workdir + "bbl_w_kernel"
+
+ with gzip.open(kernel_path_gz, 'rb') as f_in:
+ with open(kernel_path, 'wb') as f_out:
+ shutil.copyfileobj(f_in, f_out)
+
+ initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
+ '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
+ 'riscv64/rootfs.cpio.gz')
+ initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
+ initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
+
+ self.vm.set_machine('virt')
+ self.vm.set_console()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+ + 'console=ttyS0 noreboot')
+ self.vm.add_args('-kernel', kernel_path,
+ '-initrd', initrd_path,
+ '-append', kernel_command_line)
+ self.vm.launch()
+ self.wait_for_console_pattern('Boot successful.')
+
+ self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
+ 'isa')
+ self.exec_command_and_wait_for_pattern('uname -a',
+ 'sifive')
+ self.exec_command_and_wait_for_pattern('reboot',
+ 'reboot: Restarting system')
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-riscv] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-10 17:50 ` Chih-Min Chao
0 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-10 17:50 UTC (permalink / raw)
To: qemu-devel, qemu-riscv
Cc: Chih-Min Chao, Eduardo Habkost, Cleber Rosa,
Philippe Mathieu-Daudé,
Caio Carrara, Cornelia Huck
Similar to the mips + malta test, it boots a Linux kernel on a virt
board and verify the serial is working. Also, it relies on the serial
device set by the machine itself.
If riscv64 is a target being built, "make check-acceptance" will
automatically include this test by the use of the "arch:riscv64" tags.
Alternatively, this test can be run using:
$ avocado run -t arch:riscv64 tests/acceptance
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
---
tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3215950..bbc6b06 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
self.vm.launch()
console_pattern = 'Kernel command line: %s' % kernel_command_line
self.wait_for_console_pattern(console_pattern)
+
+ def test_riscv64_virt(self):
+ """
+ :avocado: tags=arch:riscv64
+ :avocado: tags=machine:virt
+ """
+
+ kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
+ '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
+ 'bbl_w_kernel.gz')
+ kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
+ kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+ kernel_path = self.workdir + "bbl_w_kernel"
+
+ with gzip.open(kernel_path_gz, 'rb') as f_in:
+ with open(kernel_path, 'wb') as f_out:
+ shutil.copyfileobj(f_in, f_out)
+
+ initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
+ '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
+ 'riscv64/rootfs.cpio.gz')
+ initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
+ initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
+
+ self.vm.set_machine('virt')
+ self.vm.set_console()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+ + 'console=ttyS0 noreboot')
+ self.vm.add_args('-kernel', kernel_path,
+ '-initrd', initrd_path,
+ '-append', kernel_command_line)
+ self.vm.launch()
+ self.wait_for_console_pattern('Boot successful.')
+
+ self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
+ 'isa')
+ self.exec_command_and_wait_for_pattern('uname -a',
+ 'sifive')
+ self.exec_command_and_wait_for_pattern('reboot',
+ 'reboot: Restarting system')
--
2.7.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-10 17:50 ` [Qemu-riscv] " Chih-Min Chao
@ 2019-07-10 18:50 ` Alistair Francis
-1 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-10 18:50 UTC (permalink / raw)
To: Chih-Min Chao
Cc: open list:RISC-V, Eduardo Habkost, Cornelia Huck,
Philippe Mathieu-Daudé,
qemu-devel@nongnu.org Developers, Caio Carrara, Cleber Rosa
On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Awesome! Thanks for the test case. This will help a lot with RISC-V
regressions in QEMU.
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
These images need to be built with a standard build flow. Having them
built from SiFive's custom scripts will make debugging problems in the
future impossible. I'm also a little worried here about GPL
violations, I'm not sure if it's enough to just point to a script SHA
to meet GPL source disclosure. I know companies have huge headaches
meeting GPL requirements so this seems too easy.
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
Don't use BBL, most people use OpenSBI now which is what we should be
testing with.
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
Same comment about build tools.
Alistair
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-10 18:50 ` Alistair Francis
0 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-10 18:50 UTC (permalink / raw)
To: Chih-Min Chao
Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé,
Cleber Rosa, Caio Carrara
On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Awesome! Thanks for the test case. This will help a lot with RISC-V
regressions in QEMU.
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
These images need to be built with a standard build flow. Having them
built from SiFive's custom scripts will make debugging problems in the
future impossible. I'm also a little worried here about GPL
violations, I'm not sure if it's enough to just point to a script SHA
to meet GPL source disclosure. I know companies have huge headaches
meeting GPL requirements so this seems too easy.
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
Don't use BBL, most people use OpenSBI now which is what we should be
testing with.
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
Same comment about build tools.
Alistair
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-10 17:50 ` [Qemu-riscv] " Chih-Min Chao
@ 2019-07-10 20:23 ` Cleber Rosa
-1 siblings, 0 replies; 18+ messages in thread
From: Cleber Rosa @ 2019-07-10 20:23 UTC (permalink / raw)
To: Chih-Min Chao
Cc: Philippe Mathieu-Daudé,
Cornelia Huck, qemu-riscv, qemu-devel, Eduardo Habkost
On Wed, Jul 10, 2019 at 10:50:23AM -0700, Chih-Min Chao wrote:
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
There are currently two patterns for extracting a gzipped file
in this test. So, this is not a must, but maybe you'd prefer:
---
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index bbc6b0683f..9f819e20e1 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -365,12 +365,8 @@ class BootLinuxConsole(Test):
'0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
'bbl_w_kernel.gz')
kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
- kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
- kernel_path = self.workdir + "bbl_w_kernel"
-
- with gzip.open(kernel_path_gz, 'rb') as f_in:
- with open(kernel_path, 'wb') as f_out:
- shutil.copyfileobj(f_in, f_out)
+ kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+ uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
'8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
@@ -382,7 +378,7 @@ class BootLinuxConsole(Test):
self.vm.set_console()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0 noreboot')
- self.vm.add_args('-kernel', kernel_path,
+ self.vm.add_args('-kernel', uncompressed_kernel,
'-initrd', initrd_path,
'-append', kernel_command_line)
self.vm.launch()
---
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
> --
> 2.7.4
>
>
It'd be nice to also add riscv64 to the target list in .travis.yaml
"acceptance tests" job.
Regards and many thanks for this contribution!
- Cleber.
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-10 20:23 ` Cleber Rosa
0 siblings, 0 replies; 18+ messages in thread
From: Cleber Rosa @ 2019-07-10 20:23 UTC (permalink / raw)
To: Chih-Min Chao
Cc: qemu-devel, qemu-riscv, Eduardo Habkost, Cornelia Huck,
Philippe Mathieu-Daudé
On Wed, Jul 10, 2019 at 10:50:23AM -0700, Chih-Min Chao wrote:
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
There are currently two patterns for extracting a gzipped file
in this test. So, this is not a must, but maybe you'd prefer:
---
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index bbc6b0683f..9f819e20e1 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -365,12 +365,8 @@ class BootLinuxConsole(Test):
'0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
'bbl_w_kernel.gz')
kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
- kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
- kernel_path = self.workdir + "bbl_w_kernel"
-
- with gzip.open(kernel_path_gz, 'rb') as f_in:
- with open(kernel_path, 'wb') as f_out:
- shutil.copyfileobj(f_in, f_out)
+ kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+ uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
'8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
@@ -382,7 +378,7 @@ class BootLinuxConsole(Test):
self.vm.set_console()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0 noreboot')
- self.vm.add_args('-kernel', kernel_path,
+ self.vm.add_args('-kernel', uncompressed_kernel,
'-initrd', initrd_path,
'-append', kernel_command_line)
self.vm.launch()
---
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
> --
> 2.7.4
>
>
It'd be nice to also add riscv64 to the target list in .travis.yaml
"acceptance tests" job.
Regards and many thanks for this contribution!
- Cleber.
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-10 18:50 ` [Qemu-riscv] " Alistair Francis
@ 2019-07-11 1:54 ` Chih-Min Chao
-1 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-11 1:54 UTC (permalink / raw)
To: Alistair Francis
Cc: open list:RISC-V, Eduardo Habkost, Cornelia Huck,
Philippe Mathieu-Daudé,
qemu-devel@nongnu.org Developers, Caio Carrara, Cleber Rosa
On Thu, Jul 11, 2019 at 2:53 AM Alistair Francis <alistair23@gmail.com>
wrote:
> On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com>
> wrote:
> >
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>
> Awesome! Thanks for the test case. This will help a lot with RISC-V
> regressions in QEMU.
>
> > ---
> > tests/acceptance/boot_linux_console.py | 40
> ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' %
> kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>
> These images need to be built with a standard build flow. Having them
> built from SiFive's custom scripts will make debugging problems in the
> future impossible. I'm also a little worried here about GPL
> violations, I'm not sure if it's enough to just point to a script SHA
> to meet GPL source disclosure. I know companies have huge headaches
> meeting GPL requirements so this seems too easy.
>
I am not very familiar with this kind of binary and source license
conflict.
Is it ok if I write a simple script with BSD license to build kernel
and image from sifive's linux/buildroot repo and commit the script to my
test-binary repo ?
>
> > +
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
>
> Don't use BBL, most people use OpenSBI now which is what we should be
> testing with.
>
I will try to move to OpenSBI in next version. My environment is based
freedom-u-sdk and It still relays on BBL. So ..:P
>
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
>
> Same comment about build tools.
>
>
> Alistair
>
> Got it
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url,
> asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting
> system')
> > --
> > 2.7.4
> >
> >
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 1:54 ` Chih-Min Chao
0 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-11 1:54 UTC (permalink / raw)
To: Alistair Francis
Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé,
Cleber Rosa, Caio Carrara
[-- Attachment #1: Type: text/plain, Size: 4321 bytes --]
On Thu, Jul 11, 2019 at 2:53 AM Alistair Francis <alistair23@gmail.com>
wrote:
> On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com>
> wrote:
> >
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>
> Awesome! Thanks for the test case. This will help a lot with RISC-V
> regressions in QEMU.
>
> > ---
> > tests/acceptance/boot_linux_console.py | 40
> ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' %
> kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>
> These images need to be built with a standard build flow. Having them
> built from SiFive's custom scripts will make debugging problems in the
> future impossible. I'm also a little worried here about GPL
> violations, I'm not sure if it's enough to just point to a script SHA
> to meet GPL source disclosure. I know companies have huge headaches
> meeting GPL requirements so this seems too easy.
>
I am not very familiar with this kind of binary and source license
conflict.
Is it ok if I write a simple script with BSD license to build kernel
and image from sifive's linux/buildroot repo and commit the script to my
test-binary repo ?
>
> > +
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
>
> Don't use BBL, most people use OpenSBI now which is what we should be
> testing with.
>
I will try to move to OpenSBI in next version. My environment is based
freedom-u-sdk and It still relays on BBL. So ..:P
>
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
>
> Same comment about build tools.
>
>
> Alistair
>
> Got it
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url,
> asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting
> system')
> > --
> > 2.7.4
> >
> >
>
[-- Attachment #2: Type: text/html, Size: 6455 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-10 20:23 ` [Qemu-riscv] " Cleber Rosa
@ 2019-07-11 2:01 ` Chih-Min Chao
-1 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-11 2:01 UTC (permalink / raw)
To: Cleber Rosa
Cc: Philippe Mathieu-Daudé,
Cornelia Huck, open list:RISC-V,
qemu-devel@nongnu.org Developers, Eduardo Habkost
On Thu, Jul 11, 2019 at 4:23 AM Cleber Rosa <crosa@redhat.com> wrote:
> On Wed, Jul 10, 2019 at 10:50:23AM -0700, Chih-Min Chao wrote:
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> > ---
> > tests/acceptance/boot_linux_console.py | 40
> ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' %
> kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> > +
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
>
> There are currently two patterns for extracting a gzipped file
> in this test. So, this is not a must, but maybe you'd prefer:
>
The suggestion is good and avocado is an awesome testing framework.
---
> diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> index bbc6b0683f..9f819e20e1 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -365,12 +365,8 @@ class BootLinuxConsole(Test):
>
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> 'bbl_w_kernel.gz')
> kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> - kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> - kernel_path = self.workdir + "bbl_w_kernel"
> -
> - with gzip.open(kernel_path_gz, 'rb') as f_in:
> - with open(kernel_path, 'wb') as f_out:
> - shutil.copyfileobj(f_in, f_out)
> + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + uncompressed_kernel = archive.uncompress(kernel_path,
> self.workdir)
>
> initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> @@ -382,7 +378,7 @@ class BootLinuxConsole(Test):
> self.vm.set_console()
> kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + 'console=ttyS0 noreboot')
> - self.vm.add_args('-kernel', kernel_path,
> + self.vm.add_args('-kernel', uncompressed_kernel,
> '-initrd', initrd_path,
> '-append', kernel_command_line)
> self.vm.launch()
> ---
>
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url,
> asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting
> system')
> > --
> > 2.7.4
> >
> >
>
> It'd be nice to also add riscv64 to the target list in .travis.yaml
> "acceptance tests" job.
>
> Regards and many thanks for this contribution!
> - Cleber.
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 2:01 ` Chih-Min Chao
0 siblings, 0 replies; 18+ messages in thread
From: Chih-Min Chao @ 2019-07-11 2:01 UTC (permalink / raw)
To: Cleber Rosa
Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé
[-- Attachment #1: Type: text/plain, Size: 5168 bytes --]
On Thu, Jul 11, 2019 at 4:23 AM Cleber Rosa <crosa@redhat.com> wrote:
> On Wed, Jul 10, 2019 at 10:50:23AM -0700, Chih-Min Chao wrote:
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> > ---
> > tests/acceptance/boot_linux_console.py | 40
> ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' %
> kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> > +
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
>
> There are currently two patterns for extracting a gzipped file
> in this test. So, this is not a must, but maybe you'd prefer:
>
The suggestion is good and avocado is an awesome testing framework.
---
> diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> index bbc6b0683f..9f819e20e1 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -365,12 +365,8 @@ class BootLinuxConsole(Test):
>
> '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> 'bbl_w_kernel.gz')
> kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> - kernel_path_gz = self.fetch_asset(kernel_url,
> asset_hash=kernel_hash)
> - kernel_path = self.workdir + "bbl_w_kernel"
> -
> - with gzip.open(kernel_path_gz, 'rb') as f_in:
> - with open(kernel_path, 'wb') as f_out:
> - shutil.copyfileobj(f_in, f_out)
> + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + uncompressed_kernel = archive.uncompress(kernel_path,
> self.workdir)
>
> initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> @@ -382,7 +378,7 @@ class BootLinuxConsole(Test):
> self.vm.set_console()
> kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + 'console=ttyS0 noreboot')
> - self.vm.add_args('-kernel', kernel_path,
> + self.vm.add_args('-kernel', uncompressed_kernel,
> '-initrd', initrd_path,
> '-append', kernel_command_line)
> self.vm.launch()
> ---
>
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url,
> asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting
> system')
> > --
> > 2.7.4
> >
> >
>
> It'd be nice to also add riscv64 to the target list in .travis.yaml
> "acceptance tests" job.
>
> Regards and many thanks for this contribution!
> - Cleber.
>
[-- Attachment #2: Type: text/html, Size: 7367 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-10 17:50 ` [Qemu-riscv] " Chih-Min Chao
@ 2019-07-11 13:56 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-11 13:56 UTC (permalink / raw)
To: Chih-Min Chao, qemu-devel, qemu-riscv
Cc: Cleber Rosa, Cornelia Huck, Eduardo Habkost, Caio Carrara,
Philippe Mathieu-Daudé
Hi Chih-Min,
On 7/10/19 7:50 PM, Chih-Min Chao wrote:
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
Good idea!
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
I recommend you to extract fw_jump.elf from [1] and
vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
[1] https://packages.debian.org/sid/all/opensbi
[2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
You might want to use '-no-reboot' here too.
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
Regards,
Phil.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 13:56 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-11 13:56 UTC (permalink / raw)
To: Chih-Min Chao, qemu-devel, qemu-riscv
Cc: Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé,
Cleber Rosa, Caio Carrara
Hi Chih-Min,
On 7/10/19 7:50 PM, Chih-Min Chao wrote:
> Similar to the mips + malta test, it boots a Linux kernel on a virt
> board and verify the serial is working. Also, it relies on the serial
> device set by the machine itself.
Good idea!
>
> If riscv64 is a target being built, "make check-acceptance" will
> automatically include this test by the use of the "arch:riscv64" tags.
>
> Alternatively, this test can be run using:
>
> $ avocado run -t arch:riscv64 tests/acceptance
>
> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> ---
> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 3215950..bbc6b06 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> self.vm.launch()
> console_pattern = 'Kernel command line: %s' % kernel_command_line
> self.wait_for_console_pattern(console_pattern)
> +
> + def test_riscv64_virt(self):
> + """
> + :avocado: tags=arch:riscv64
> + :avocado: tags=machine:virt
> + """
> +
> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> + 'bbl_w_kernel.gz')
I recommend you to extract fw_jump.elf from [1] and
vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
[1] https://packages.debian.org/sid/all/opensbi
[2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> + kernel_path = self.workdir + "bbl_w_kernel"
> +
> + with gzip.open(kernel_path_gz, 'rb') as f_in:
> + with open(kernel_path, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
> +
> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> + 'riscv64/rootfs.cpio.gz')
> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> +
> + self.vm.set_machine('virt')
> + self.vm.set_console()
> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> + + 'console=ttyS0 noreboot')
> + self.vm.add_args('-kernel', kernel_path,
> + '-initrd', initrd_path,
> + '-append', kernel_command_line)
You might want to use '-no-reboot' here too.
> + self.vm.launch()
> + self.wait_for_console_pattern('Boot successful.')
> +
> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> + 'isa')
> + self.exec_command_and_wait_for_pattern('uname -a',
> + 'sifive')
> + self.exec_command_and_wait_for_pattern('reboot',
> + 'reboot: Restarting system')
Regards,
Phil.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-11 1:54 ` [Qemu-riscv] " Chih-Min Chao
@ 2019-07-11 14:41 ` Alistair Francis
-1 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-11 14:41 UTC (permalink / raw)
To: Chih-Min Chao
Cc: open list:RISC-V, Eduardo Habkost, Cornelia Huck,
Philippe Mathieu-Daudé,
qemu-devel@nongnu.org Developers, Caio Carrara, Cleber Rosa
On Wed, Jul 10, 2019 at 6:54 PM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>
>
> On Thu, Jul 11, 2019 at 2:53 AM Alistair Francis <alistair23@gmail.com> wrote:
>>
>> On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>> >
>> > Similar to the mips + malta test, it boots a Linux kernel on a virt
>> > board and verify the serial is working. Also, it relies on the serial
>> > device set by the machine itself.
>> >
>> > If riscv64 is a target being built, "make check-acceptance" will
>> > automatically include this test by the use of the "arch:riscv64" tags.
>> >
>> > Alternatively, this test can be run using:
>> >
>> > $ avocado run -t arch:riscv64 tests/acceptance
>> >
>> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>>
>> Awesome! Thanks for the test case. This will help a lot with RISC-V
>> regressions in QEMU.
>>
>> > ---
>> > tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
>> > 1 file changed, 40 insertions(+)
>> >
>> > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
>> > index 3215950..bbc6b06 100644
>> > --- a/tests/acceptance/boot_linux_console.py
>> > +++ b/tests/acceptance/boot_linux_console.py
>> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
>> > self.vm.launch()
>> > console_pattern = 'Kernel command line: %s' % kernel_command_line
>> > self.wait_for_console_pattern(console_pattern)
>> > +
>> > + def test_riscv64_virt(self):
>> > + """
>> > + :avocado: tags=arch:riscv64
>> > + :avocado: tags=machine:virt
>> > + """
>> > +
>> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>>
>> These images need to be built with a standard build flow. Having them
>> built from SiFive's custom scripts will make debugging problems in the
>> future impossible. I'm also a little worried here about GPL
>> violations, I'm not sure if it's enough to just point to a script SHA
>> to meet GPL source disclosure. I know companies have huge headaches
>> meeting GPL requirements so this seems too easy.
>
>
> I am not very familiar with this kind of binary and source license conflict.
Thinking about it more you probably are ok with a SHA to a build tool.
I guess companies do all the extra work and vetting just to be extra
sure. So how much you do I guess is up to you ad SiFive.
> Is it ok if I write a simple script with BSD license to build kernel and image from sifive's linux/buildroot repo and commit the script to my test-binary repo ?
No, it must be built from an upstream repo. Others need to be able to
reproduce this in the future. You can just use upstream buildroot and
include a config. Ideally as well use a projects release instead of
some random SHA.
>>
>>
>> > + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
>> > + 'bbl_w_kernel.gz')
>>
>> Don't use BBL, most people use OpenSBI now which is what we should be
>> testing with.
>
> I will try to move to OpenSBI in next version. My environment is based freedom-u-sdk and It still relays on BBL. So ..:P
Swap to an upstream distro, I think they all support OpenSBI now.
Buildroot and OE/Yocto both give you development environments and
Fedora and Debian work as well.
Alistair
>>
>>
>> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
>> > + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
>> > + kernel_path = self.workdir + "bbl_w_kernel"
>> > +
>> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
>> > + with open(kernel_path, 'wb') as f_out:
>> > + shutil.copyfileobj(f_in, f_out)
>> > +
>> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
>> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
>> > + 'riscv64/rootfs.cpio.gz')
>>
>> Same comment about build tools.
>>
>>
>> Alistair
>>
> Got it
>>
>> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
>> > + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
>> > +
>> > + self.vm.set_machine('virt')
>> > + self.vm.set_console()
>> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
>> > + + 'console=ttyS0 noreboot')
>> > + self.vm.add_args('-kernel', kernel_path,
>> > + '-initrd', initrd_path,
>> > + '-append', kernel_command_line)
>> > + self.vm.launch()
>> > + self.wait_for_console_pattern('Boot successful.')
>> > +
>> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>> > + 'isa')
>> > + self.exec_command_and_wait_for_pattern('uname -a',
>> > + 'sifive')
>> > + self.exec_command_and_wait_for_pattern('reboot',
>> > + 'reboot: Restarting system')
>> > --
>> > 2.7.4
>> >
>> >
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 14:41 ` Alistair Francis
0 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-11 14:41 UTC (permalink / raw)
To: Chih-Min Chao
Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
Eduardo Habkost, Cornelia Huck, Philippe Mathieu-Daudé,
Cleber Rosa, Caio Carrara
On Wed, Jul 10, 2019 at 6:54 PM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>
>
> On Thu, Jul 11, 2019 at 2:53 AM Alistair Francis <alistair23@gmail.com> wrote:
>>
>> On Wed, Jul 10, 2019 at 10:51 AM Chih-Min Chao <chihmin.chao@sifive.com> wrote:
>> >
>> > Similar to the mips + malta test, it boots a Linux kernel on a virt
>> > board and verify the serial is working. Also, it relies on the serial
>> > device set by the machine itself.
>> >
>> > If riscv64 is a target being built, "make check-acceptance" will
>> > automatically include this test by the use of the "arch:riscv64" tags.
>> >
>> > Alternatively, this test can be run using:
>> >
>> > $ avocado run -t arch:riscv64 tests/acceptance
>> >
>> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>>
>> Awesome! Thanks for the test case. This will help a lot with RISC-V
>> regressions in QEMU.
>>
>> > ---
>> > tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
>> > 1 file changed, 40 insertions(+)
>> >
>> > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
>> > index 3215950..bbc6b06 100644
>> > --- a/tests/acceptance/boot_linux_console.py
>> > +++ b/tests/acceptance/boot_linux_console.py
>> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
>> > self.vm.launch()
>> > console_pattern = 'Kernel command line: %s' % kernel_command_line
>> > self.wait_for_console_pattern(console_pattern)
>> > +
>> > + def test_riscv64_virt(self):
>> > + """
>> > + :avocado: tags=arch:riscv64
>> > + :avocado: tags=machine:virt
>> > + """
>> > +
>> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>>
>> These images need to be built with a standard build flow. Having them
>> built from SiFive's custom scripts will make debugging problems in the
>> future impossible. I'm also a little worried here about GPL
>> violations, I'm not sure if it's enough to just point to a script SHA
>> to meet GPL source disclosure. I know companies have huge headaches
>> meeting GPL requirements so this seems too easy.
>
>
> I am not very familiar with this kind of binary and source license conflict.
Thinking about it more you probably are ok with a SHA to a build tool.
I guess companies do all the extra work and vetting just to be extra
sure. So how much you do I guess is up to you ad SiFive.
> Is it ok if I write a simple script with BSD license to build kernel and image from sifive's linux/buildroot repo and commit the script to my test-binary repo ?
No, it must be built from an upstream repo. Others need to be able to
reproduce this in the future. You can just use upstream buildroot and
include a config. Ideally as well use a projects release instead of
some random SHA.
>>
>>
>> > + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
>> > + 'bbl_w_kernel.gz')
>>
>> Don't use BBL, most people use OpenSBI now which is what we should be
>> testing with.
>
> I will try to move to OpenSBI in next version. My environment is based freedom-u-sdk and It still relays on BBL. So ..:P
Swap to an upstream distro, I think they all support OpenSBI now.
Buildroot and OE/Yocto both give you development environments and
Fedora and Debian work as well.
Alistair
>>
>>
>> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
>> > + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
>> > + kernel_path = self.workdir + "bbl_w_kernel"
>> > +
>> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
>> > + with open(kernel_path, 'wb') as f_out:
>> > + shutil.copyfileobj(f_in, f_out)
>> > +
>> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
>> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
>> > + 'riscv64/rootfs.cpio.gz')
>>
>> Same comment about build tools.
>>
>>
>> Alistair
>>
> Got it
>>
>> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
>> > + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
>> > +
>> > + self.vm.set_machine('virt')
>> > + self.vm.set_console()
>> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
>> > + + 'console=ttyS0 noreboot')
>> > + self.vm.add_args('-kernel', kernel_path,
>> > + '-initrd', initrd_path,
>> > + '-append', kernel_command_line)
>> > + self.vm.launch()
>> > + self.wait_for_console_pattern('Boot successful.')
>> > +
>> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>> > + 'isa')
>> > + self.exec_command_and_wait_for_pattern('uname -a',
>> > + 'sifive')
>> > + self.exec_command_and_wait_for_pattern('reboot',
>> > + 'reboot: Restarting system')
>> > --
>> > 2.7.4
>> >
>> >
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-11 13:56 ` [Qemu-riscv] " Philippe Mathieu-Daudé
@ 2019-07-11 14:43 ` Alistair Francis
-1 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-11 14:43 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: open list:RISC-V, Eduardo Habkost, Cornelia Huck,
qemu-devel@nongnu.org Developers, Philippe Mathieu-Daudé,
Chih-Min Chao, Caio Carrara, Cleber Rosa
On Thu, Jul 11, 2019 at 6:56 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Hi Chih-Min,
>
> On 7/10/19 7:50 PM, Chih-Min Chao wrote:
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
>
> Good idea!
>
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> > ---
> > tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' % kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> > + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
>
> I recommend you to extract fw_jump.elf from [1] and
> vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
>
> [1] https://packages.debian.org/sid/all/opensbi
> [2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
This will works as well if you don't want to bother building the
images yourself. Ideally we could use a newer kernel then 4.19 but for
an acceptance test it probably doesn't matter much.
This way Debain has done all the licence work for you as well :)
Alistair
>
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
>
> You might want to use '-no-reboot' here too.
>
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting system')
>
> Regards,
>
> Phil.
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 14:43 ` Alistair Francis
0 siblings, 0 replies; 18+ messages in thread
From: Alistair Francis @ 2019-07-11 14:43 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Chih-Min Chao, qemu-devel@nongnu.org Developers,
open list:RISC-V, Cleber Rosa, Cornelia Huck, Eduardo Habkost,
Caio Carrara, Philippe Mathieu-Daudé
On Thu, Jul 11, 2019 at 6:56 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> Hi Chih-Min,
>
> On 7/10/19 7:50 PM, Chih-Min Chao wrote:
> > Similar to the mips + malta test, it boots a Linux kernel on a virt
> > board and verify the serial is working. Also, it relies on the serial
> > device set by the machine itself.
>
> Good idea!
>
> >
> > If riscv64 is a target being built, "make check-acceptance" will
> > automatically include this test by the use of the "arch:riscv64" tags.
> >
> > Alternatively, this test can be run using:
> >
> > $ avocado run -t arch:riscv64 tests/acceptance
> >
> > Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
> > ---
> > tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
> > 1 file changed, 40 insertions(+)
> >
> > diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> > index 3215950..bbc6b06 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
> > self.vm.launch()
> > console_pattern = 'Kernel command line: %s' % kernel_command_line
> > self.wait_for_console_pattern(console_pattern)
> > +
> > + def test_riscv64_virt(self):
> > + """
> > + :avocado: tags=arch:riscv64
> > + :avocado: tags=machine:virt
> > + """
> > +
> > + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
> > + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
> > + 'bbl_w_kernel.gz')
>
> I recommend you to extract fw_jump.elf from [1] and
> vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
>
> [1] https://packages.debian.org/sid/all/opensbi
> [2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
This will works as well if you don't want to bother building the
images yourself. Ideally we could use a newer kernel then 4.19 but for
an acceptance test it probably doesn't matter much.
This way Debain has done all the licence work for you as well :)
Alistair
>
> > + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
> > + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> > + kernel_path = self.workdir + "bbl_w_kernel"
> > +
> > + with gzip.open(kernel_path_gz, 'rb') as f_in:
> > + with open(kernel_path, 'wb') as f_out:
> > + shutil.copyfileobj(f_in, f_out)
> > +
> > + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> > + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
> > + 'riscv64/rootfs.cpio.gz')
> > + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
> > + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
> > +
> > + self.vm.set_machine('virt')
> > + self.vm.set_console()
> > + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
> > + + 'console=ttyS0 noreboot')
> > + self.vm.add_args('-kernel', kernel_path,
> > + '-initrd', initrd_path,
> > + '-append', kernel_command_line)
>
> You might want to use '-no-reboot' here too.
>
> > + self.vm.launch()
> > + self.wait_for_console_pattern('Boot successful.')
> > +
> > + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
> > + 'isa')
> > + self.exec_command_and_wait_for_pattern('uname -a',
> > + 'sifive')
> > + self.exec_command_and_wait_for_pattern('reboot',
> > + 'reboot: Restarting system')
>
> Regards,
>
> Phil.
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
2019-07-11 14:43 ` [Qemu-riscv] " Alistair Francis
@ 2019-07-11 14:54 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-11 14:54 UTC (permalink / raw)
To: Alistair Francis
Cc: open list:RISC-V, Eduardo Habkost, Cornelia Huck,
qemu-devel@nongnu.org Developers, Philippe Mathieu-Daudé,
Chih-Min Chao, Caio Carrara, Cleber Rosa
On 7/11/19 4:43 PM, Alistair Francis wrote:
> On Thu, Jul 11, 2019 at 6:56 AM Philippe Mathieu-Daudé
> <philmd@redhat.com> wrote:
>>
>> Hi Chih-Min,
>>
>> On 7/10/19 7:50 PM, Chih-Min Chao wrote:
>>> Similar to the mips + malta test, it boots a Linux kernel on a virt
>>> board and verify the serial is working. Also, it relies on the serial
>>> device set by the machine itself.
>>
>> Good idea!
>>
>>>
>>> If riscv64 is a target being built, "make check-acceptance" will
>>> automatically include this test by the use of the "arch:riscv64" tags.
>>>
>>> Alternatively, this test can be run using:
>>>
>>> $ avocado run -t arch:riscv64 tests/acceptance
>>>
>>> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>>> ---
>>> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
>>> 1 file changed, 40 insertions(+)
>>>
>>> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
>>> index 3215950..bbc6b06 100644
>>> --- a/tests/acceptance/boot_linux_console.py
>>> +++ b/tests/acceptance/boot_linux_console.py
>>> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
>>> self.vm.launch()
>>> console_pattern = 'Kernel command line: %s' % kernel_command_line
>>> self.wait_for_console_pattern(console_pattern)
>>> +
>>> + def test_riscv64_virt(self):
>>> + """
>>> + :avocado: tags=arch:riscv64
>>> + :avocado: tags=machine:virt
>>> + """
>>> +
>>> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>>> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
>>> + 'bbl_w_kernel.gz')
>>
>> I recommend you to extract fw_jump.elf from [1] and
>> vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
>>
>> [1] https://packages.debian.org/sid/all/opensbi
>> [2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
>
> This will works as well if you don't want to bother building the
> images yourself. Ideally we could use a newer kernel then 4.19 but for
> an acceptance test it probably doesn't matter much.
This one is available in 'experimental', in case you want to test it
too, but I'd rather use some stable channel for testing:
https://packages.debian.org/experimental/linux-image-5.0.0-trunk-riscv64
> This way Debain has done all the licence work for you as well :)
And all the building work ;)
>
> Alistair
>
>>
>>> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
>>> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
>>> + kernel_path = self.workdir + "bbl_w_kernel"
>>> +
>>> + with gzip.open(kernel_path_gz, 'rb') as f_in:
>>> + with open(kernel_path, 'wb') as f_out:
>>> + shutil.copyfileobj(f_in, f_out)
>>> +
>>> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
>>> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
>>> + 'riscv64/rootfs.cpio.gz')
>>> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
>>> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
>>> +
>>> + self.vm.set_machine('virt')
>>> + self.vm.set_console()
>>> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
>>> + + 'console=ttyS0 noreboot')
>>> + self.vm.add_args('-kernel', kernel_path,
>>> + '-initrd', initrd_path,
>>> + '-append', kernel_command_line)
>>
>> You might want to use '-no-reboot' here too.
>>
>>> + self.vm.launch()
>>> + self.wait_for_console_pattern('Boot successful.')
>>> +
>>> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>>> + 'isa')
>>> + self.exec_command_and_wait_for_pattern('uname -a',
>>> + 'sifive')
>>> + self.exec_command_and_wait_for_pattern('reboot',
>>> + 'reboot: Restarting system')
>>
>> Regards,
>>
>> Phil.
>>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-riscv] [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt
@ 2019-07-11 14:54 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 18+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-11 14:54 UTC (permalink / raw)
To: Alistair Francis
Cc: Chih-Min Chao, qemu-devel@nongnu.org Developers,
open list:RISC-V, Cleber Rosa, Cornelia Huck, Eduardo Habkost,
Caio Carrara, Philippe Mathieu-Daudé
On 7/11/19 4:43 PM, Alistair Francis wrote:
> On Thu, Jul 11, 2019 at 6:56 AM Philippe Mathieu-Daudé
> <philmd@redhat.com> wrote:
>>
>> Hi Chih-Min,
>>
>> On 7/10/19 7:50 PM, Chih-Min Chao wrote:
>>> Similar to the mips + malta test, it boots a Linux kernel on a virt
>>> board and verify the serial is working. Also, it relies on the serial
>>> device set by the machine itself.
>>
>> Good idea!
>>
>>>
>>> If riscv64 is a target being built, "make check-acceptance" will
>>> automatically include this test by the use of the "arch:riscv64" tags.
>>>
>>> Alternatively, this test can be run using:
>>>
>>> $ avocado run -t arch:riscv64 tests/acceptance
>>>
>>> Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
>>> ---
>>> tests/acceptance/boot_linux_console.py | 40 ++++++++++++++++++++++++++++++++++
>>> 1 file changed, 40 insertions(+)
>>>
>>> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
>>> index 3215950..bbc6b06 100644
>>> --- a/tests/acceptance/boot_linux_console.py
>>> +++ b/tests/acceptance/boot_linux_console.py
>>> @@ -354,3 +354,43 @@ class BootLinuxConsole(Test):
>>> self.vm.launch()
>>> console_pattern = 'Kernel command line: %s' % kernel_command_line
>>> self.wait_for_console_pattern(console_pattern)
>>> +
>>> + def test_riscv64_virt(self):
>>> + """
>>> + :avocado: tags=arch:riscv64
>>> + :avocado: tags=machine:virt
>>> + """
>>> +
>>> + kernel_url = ('https://github.com/chihminchao/test-binary/raw/'
>>> + '0b7787305d9e40815c05a805266cc74ff356239e/qemu/riscv64/'
>>> + 'bbl_w_kernel.gz')
>>
>> I recommend you to extract fw_jump.elf from [1] and
>> vmlinux-4.19.0-5-riscv64 from [2] with the extract_from_deb() helper.
>>
>> [1] https://packages.debian.org/sid/all/opensbi
>> [2] https://packages.debian.org/sid/linux-image-4.19.0-5-riscv64
>
> This will works as well if you don't want to bother building the
> images yourself. Ideally we could use a newer kernel then 4.19 but for
> an acceptance test it probably doesn't matter much.
This one is available in 'experimental', in case you want to test it
too, but I'd rather use some stable channel for testing:
https://packages.debian.org/experimental/linux-image-5.0.0-trunk-riscv64
> This way Debain has done all the licence work for you as well :)
And all the building work ;)
>
> Alistair
>
>>
>>> + kernel_hash = 'c7f6cc7967975ad42dc61ee0535db01c9cbd0968'
>>> + kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
>>> + kernel_path = self.workdir + "bbl_w_kernel"
>>> +
>>> + with gzip.open(kernel_path_gz, 'rb') as f_in:
>>> + with open(kernel_path, 'wb') as f_out:
>>> + shutil.copyfileobj(f_in, f_out)
>>> +
>>> + initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
>>> + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
>>> + 'riscv64/rootfs.cpio.gz')
>>> + initrd_hash = 'f4867d263754961b6f626cdcdc0cb334c47e3b49'
>>> + initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
>>> +
>>> + self.vm.set_machine('virt')
>>> + self.vm.set_console()
>>> + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
>>> + + 'console=ttyS0 noreboot')
>>> + self.vm.add_args('-kernel', kernel_path,
>>> + '-initrd', initrd_path,
>>> + '-append', kernel_command_line)
>>
>> You might want to use '-no-reboot' here too.
>>
>>> + self.vm.launch()
>>> + self.wait_for_console_pattern('Boot successful.')
>>> +
>>> + self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo',
>>> + 'isa')
>>> + self.exec_command_and_wait_for_pattern('uname -a',
>>> + 'sifive')
>>> + self.exec_command_and_wait_for_pattern('reboot',
>>> + 'reboot: Restarting system')
>>
>> Regards,
>>
>> Phil.
>>
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2019-07-11 14:55 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 17:50 [Qemu-devel] [PATCH] tests/boot_linux_console: add a test for riscv64 + virt Chih-Min Chao
2019-07-10 17:50 ` [Qemu-riscv] " Chih-Min Chao
2019-07-10 18:50 ` [Qemu-devel] " Alistair Francis
2019-07-10 18:50 ` [Qemu-riscv] " Alistair Francis
2019-07-11 1:54 ` Chih-Min Chao
2019-07-11 1:54 ` [Qemu-riscv] " Chih-Min Chao
2019-07-11 14:41 ` Alistair Francis
2019-07-11 14:41 ` [Qemu-riscv] " Alistair Francis
2019-07-10 20:23 ` Cleber Rosa
2019-07-10 20:23 ` [Qemu-riscv] " Cleber Rosa
2019-07-11 2:01 ` Chih-Min Chao
2019-07-11 2:01 ` [Qemu-riscv] " Chih-Min Chao
2019-07-11 13:56 ` Philippe Mathieu-Daudé
2019-07-11 13:56 ` [Qemu-riscv] " Philippe Mathieu-Daudé
2019-07-11 14:43 ` Alistair Francis
2019-07-11 14:43 ` [Qemu-riscv] " Alistair Francis
2019-07-11 14:54 ` Philippe Mathieu-Daudé
2019-07-11 14:54 ` [Qemu-riscv] " Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.