Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-18 Thread Chih-Min Chao
On Thu, Jul 18, 2019 at 11:34 PM Alistair Francis 
wrote:

> On Thu, Jul 18, 2019 at 8:00 AM Chih-Min Chao 
> wrote:
> >
> >
> >
> > On Thu, Jul 18, 2019 at 6:47 AM Alistair Francis 
> wrote:
> >>
> >> On Tue, Jul 16, 2019 at 10:21 PM Chih-Min Chao 
> wrote:
> >> >
> >> >
> >> >
> >> > On Wed, Jul 17, 2019 at 6:59 AM Alistair Francis <
> alistai...@gmail.com> wrote:
> >> >>
> >> >> On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
> >> >>  wrote:
> >> >> >
> >> >> > On 7/16/19 10:43 PM, Alistair Francis wrote:
> >> >> > > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao <
> chihmin.c...@sifive.com> wrote:
> >> >> > >>
> >> >> > >>
> >> >> > >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis <
> alistai...@gmail.com> wrote:
> >> >> > >>>
> >> >> > >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
> >> >> > >>>  wrote:
> >> >> > 
> >> >> >  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> >> >> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> >> >> > > mailto:phi...@redhat.com>> wrote:
> >> >> > >
> >> >> > > On 7/15/19 11:08 AM, 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
> >> >> > > >
> >> >> > > > packages
> >> >> > > >   debian official
> >> >> > > > binutils-riscv64-linux-gnu_2.32-8
> >> >> > > > opensbi_0.4-1_all
> >> >> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
> >> >> > > >   third-party
> >> >> > > >
> >> >> > >
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> >> >> > > > (the repo is also used in mips target acceptance)
> >> >> > > >
> >> >> > > > Signed-off-by: Chih-Min Chao  >> >> > > >
> >> >> > > > ---
> >> >> > > >  .travis.yml|  2 +-
> >> >> > > >  tests/acceptance/boot_linux_console.py | 66
> >> >> > > ++
> >> >> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
> >> >> > > >
> >> >> > > > diff --git a/.travis.yml b/.travis.yml
> >> >> > > > index 5d3d6ee..21fcead 100644
> >> >> > > > --- a/.travis.yml
> >> >> > > > +++ b/.travis.yml
> >> >> > > > @@ -232,7 +232,7 @@ matrix:
> >> >> > > >
> >> >> > > >  # Acceptance (Functional) tests
> >> >> > > >  - env:
> >> >> > > > -- CONFIG="--python=/usr/bin/python3
> >> >> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> >> >> > > > +- CONFIG="--python=/usr/bin/python3
> >> >> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> >> >> > > >  - TEST_CMD="make check-acceptance"
> >> >> > > >after_failure:
> >> >> > > >  - cat tests/results/latest/job.log
> >> >> > > > diff --git a/tests/acceptance/boot_linux_console.py
> >> >> > > b/tests/acceptance/boot_linux_console.py
> >> >> > > > index 3215950..0f638bc 100644
> >> >> > > > --- a/tests/acceptance/boot_linux_console.py
> >> >> > > > +++ b/tests/acceptance/boot_linux_console.py
> >> >> > > > @@ -354,3 +354,69 @@ 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
> >> >> > > > +"""
> >> >> > > > +deb_url = ('
> https://snapshot.debian.org/archive/debian/'
> >> >> > > > +
>  '20190424T171759Z/pool/main/b/binutils/'
> >> >> > > > +
> >> >> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> >> >> > > > +deb_hash =
> ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> >> >> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> >> >> > > > +

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-18 Thread Alistair Francis
On Thu, Jul 18, 2019 at 8:00 AM Chih-Min Chao  wrote:
>
>
>
> On Thu, Jul 18, 2019 at 6:47 AM Alistair Francis  wrote:
>>
>> On Tue, Jul 16, 2019 at 10:21 PM Chih-Min Chao  
>> wrote:
>> >
>> >
>> >
>> > On Wed, Jul 17, 2019 at 6:59 AM Alistair Francis  
>> > wrote:
>> >>
>> >> On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
>> >>  wrote:
>> >> >
>> >> > On 7/16/19 10:43 PM, Alistair Francis wrote:
>> >> > > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao 
>> >> > >  wrote:
>> >> > >>
>> >> > >>
>> >> > >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis 
>> >> > >>  wrote:
>> >> > >>>
>> >> > >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
>> >> > >>>  wrote:
>> >> > 
>> >> >  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
>> >> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
>> >> > > mailto:phi...@redhat.com>> wrote:
>> >> > >
>> >> > > On 7/15/19 11:08 AM, 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
>> >> > > >
>> >> > > > packages
>> >> > > >   debian official
>> >> > > > binutils-riscv64-linux-gnu_2.32-8
>> >> > > > opensbi_0.4-1_all
>> >> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
>> >> > > >   third-party
>> >> > > >
>> >> > >  
>> >> > > https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
>> >> > > > (the repo is also used in mips target acceptance)
>> >> > > >
>> >> > > > Signed-off-by: Chih-Min Chao > >> > > >
>> >> > > > ---
>> >> > > >  .travis.yml|  2 +-
>> >> > > >  tests/acceptance/boot_linux_console.py | 66
>> >> > > ++
>> >> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
>> >> > > >
>> >> > > > diff --git a/.travis.yml b/.travis.yml
>> >> > > > index 5d3d6ee..21fcead 100644
>> >> > > > --- a/.travis.yml
>> >> > > > +++ b/.travis.yml
>> >> > > > @@ -232,7 +232,7 @@ matrix:
>> >> > > >
>> >> > > >  # Acceptance (Functional) tests
>> >> > > >  - env:
>> >> > > > -- CONFIG="--python=/usr/bin/python3
>> >> > > 
>> >> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
>> >> > > > +- CONFIG="--python=/usr/bin/python3
>> >> > > 
>> >> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
>> >> > > >  - TEST_CMD="make check-acceptance"
>> >> > > >after_failure:
>> >> > > >  - cat tests/results/latest/job.log
>> >> > > > diff --git a/tests/acceptance/boot_linux_console.py
>> >> > > b/tests/acceptance/boot_linux_console.py
>> >> > > > index 3215950..0f638bc 100644
>> >> > > > --- a/tests/acceptance/boot_linux_console.py
>> >> > > > +++ b/tests/acceptance/boot_linux_console.py
>> >> > > > @@ -354,3 +354,69 @@ 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
>> >> > > > +"""
>> >> > > > +deb_url = 
>> >> > > ('https://snapshot.debian.org/archive/debian/'
>> >> > > > + 
>> >> > > '20190424T171759Z/pool/main/b/binutils/'
>> >> > > > +
>> >> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
>> >> > > > +deb_hash = 
>> >> > > ('7fe376fd4452696c03acd508d6d613ca553ea15e')
>> >> > > > +deb_path = self.fetch_asset(deb_url, 
>> >> > > asset_hash=deb_hash)
>> >> > > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
>> >> > > > +objcopy_path = self.extract_from_deb(deb_path, 
>> >> > 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-18 Thread Chih-Min Chao
On Thu, Jul 18, 2019 at 6:47 AM Alistair Francis 
wrote:

> On Tue, Jul 16, 2019 at 10:21 PM Chih-Min Chao 
> wrote:
> >
> >
> >
> > On Wed, Jul 17, 2019 at 6:59 AM Alistair Francis 
> wrote:
> >>
> >> On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
> >>  wrote:
> >> >
> >> > On 7/16/19 10:43 PM, Alistair Francis wrote:
> >> > > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao <
> chihmin.c...@sifive.com> wrote:
> >> > >>
> >> > >>
> >> > >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis <
> alistai...@gmail.com> wrote:
> >> > >>>
> >> > >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
> >> > >>>  wrote:
> >> > 
> >> >  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> >> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> >> > > mailto:phi...@redhat.com>> wrote:
> >> > >
> >> > > On 7/15/19 11:08 AM, 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
> >> > > >
> >> > > > packages
> >> > > >   debian official
> >> > > > binutils-riscv64-linux-gnu_2.32-8
> >> > > > opensbi_0.4-1_all
> >> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
> >> > > >   third-party
> >> > > >
> >> > >
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> >> > > > (the repo is also used in mips target acceptance)
> >> > > >
> >> > > > Signed-off-by: Chih-Min Chao  >> > > >
> >> > > > ---
> >> > > >  .travis.yml|  2 +-
> >> > > >  tests/acceptance/boot_linux_console.py | 66
> >> > > ++
> >> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
> >> > > >
> >> > > > diff --git a/.travis.yml b/.travis.yml
> >> > > > index 5d3d6ee..21fcead 100644
> >> > > > --- a/.travis.yml
> >> > > > +++ b/.travis.yml
> >> > > > @@ -232,7 +232,7 @@ matrix:
> >> > > >
> >> > > >  # Acceptance (Functional) tests
> >> > > >  - env:
> >> > > > -- CONFIG="--python=/usr/bin/python3
> >> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> >> > > > +- CONFIG="--python=/usr/bin/python3
> >> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> >> > > >  - TEST_CMD="make check-acceptance"
> >> > > >after_failure:
> >> > > >  - cat tests/results/latest/job.log
> >> > > > diff --git a/tests/acceptance/boot_linux_console.py
> >> > > b/tests/acceptance/boot_linux_console.py
> >> > > > index 3215950..0f638bc 100644
> >> > > > --- a/tests/acceptance/boot_linux_console.py
> >> > > > +++ b/tests/acceptance/boot_linux_console.py
> >> > > > @@ -354,3 +354,69 @@ 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
> >> > > > +"""
> >> > > > +deb_url = ('
> https://snapshot.debian.org/archive/debian/'
> >> > > > +
>  '20190424T171759Z/pool/main/b/binutils/'
> >> > > > +
> >> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> >> > > > +deb_hash =
> ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> >> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> >> > > > +objcopy_path =
> '/usr/bin/riscv64-linux-gnu-objcopy'
> >> > > > +objcopy_path = self.extract_from_deb(deb_path,
> objcopy_path)
> >> > > > +libbfd_path =
> >> > > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> >> > > '
> >> > > > +libbfd_path = self.extract_from_deb(deb_path,
> libbfd_path)
> >> > > > +process.run('ls 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-17 Thread Alistair Francis
On Tue, Jul 16, 2019 at 10:21 PM Chih-Min Chao  wrote:
>
>
>
> On Wed, Jul 17, 2019 at 6:59 AM Alistair Francis  wrote:
>>
>> On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
>>  wrote:
>> >
>> > On 7/16/19 10:43 PM, Alistair Francis wrote:
>> > > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao  
>> > > wrote:
>> > >>
>> > >>
>> > >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis 
>> > >>  wrote:
>> > >>>
>> > >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
>> > >>>  wrote:
>> > 
>> >  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
>> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
>> > > mailto:phi...@redhat.com>> wrote:
>> > >
>> > > On 7/15/19 11:08 AM, 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
>> > > >
>> > > > packages
>> > > >   debian official
>> > > > binutils-riscv64-linux-gnu_2.32-8
>> > > > opensbi_0.4-1_all
>> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
>> > > >   third-party
>> > > >
>> > >  
>> > > https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
>> > > > (the repo is also used in mips target acceptance)
>> > > >
>> > > > Signed-off-by: Chih-Min Chao > > > >
>> > > > ---
>> > > >  .travis.yml|  2 +-
>> > > >  tests/acceptance/boot_linux_console.py | 66
>> > > ++
>> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
>> > > >
>> > > > diff --git a/.travis.yml b/.travis.yml
>> > > > index 5d3d6ee..21fcead 100644
>> > > > --- a/.travis.yml
>> > > > +++ b/.travis.yml
>> > > > @@ -232,7 +232,7 @@ matrix:
>> > > >
>> > > >  # Acceptance (Functional) tests
>> > > >  - env:
>> > > > -- CONFIG="--python=/usr/bin/python3
>> > > 
>> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
>> > > > +- CONFIG="--python=/usr/bin/python3
>> > > 
>> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
>> > > >  - TEST_CMD="make check-acceptance"
>> > > >after_failure:
>> > > >  - cat tests/results/latest/job.log
>> > > > diff --git a/tests/acceptance/boot_linux_console.py
>> > > b/tests/acceptance/boot_linux_console.py
>> > > > index 3215950..0f638bc 100644
>> > > > --- a/tests/acceptance/boot_linux_console.py
>> > > > +++ b/tests/acceptance/boot_linux_console.py
>> > > > @@ -354,3 +354,69 @@ 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
>> > > > +"""
>> > > > +deb_url = 
>> > > ('https://snapshot.debian.org/archive/debian/'
>> > > > + 
>> > > '20190424T171759Z/pool/main/b/binutils/'
>> > > > +
>> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
>> > > > +deb_hash = 
>> > > ('7fe376fd4452696c03acd508d6d613ca553ea15e')
>> > > > +deb_path = self.fetch_asset(deb_url, 
>> > > asset_hash=deb_hash)
>> > > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
>> > > > +objcopy_path = self.extract_from_deb(deb_path, 
>> > > objcopy_path)
>> > > > +libbfd_path =
>> > > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
>> > > '
>> > > > +libbfd_path = self.extract_from_deb(deb_path, 
>> > > libbfd_path)
>> > > > +process.run('ls -al %s' % (objcopy_path))
>> > > > +
>> > > > +deb_url = 
>> > > 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-16 Thread Chih-Min Chao
On Wed, Jul 17, 2019 at 6:59 AM Alistair Francis 
wrote:

> On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
>  wrote:
> >
> > On 7/16/19 10:43 PM, Alistair Francis wrote:
> > > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao 
> wrote:
> > >>
> > >>
> > >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis <
> alistai...@gmail.com> wrote:
> > >>>
> > >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
> > >>>  wrote:
> > 
> >  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> > > mailto:phi...@redhat.com>> wrote:
> > >
> > > On 7/15/19 11:08 AM, 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
> > > >
> > > > packages
> > > >   debian official
> > > > binutils-riscv64-linux-gnu_2.32-8
> > > > opensbi_0.4-1_all
> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
> > > >   third-party
> > > >
> > >
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > > > (the repo is also used in mips target acceptance)
> > > >
> > > > Signed-off-by: Chih-Min Chao  > > >
> > > > ---
> > > >  .travis.yml|  2 +-
> > > >  tests/acceptance/boot_linux_console.py | 66
> > > ++
> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/.travis.yml b/.travis.yml
> > > > index 5d3d6ee..21fcead 100644
> > > > --- a/.travis.yml
> > > > +++ b/.travis.yml
> > > > @@ -232,7 +232,7 @@ matrix:
> > > >
> > > >  # Acceptance (Functional) tests
> > > >  - env:
> > > > -- CONFIG="--python=/usr/bin/python3
> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > > > +- CONFIG="--python=/usr/bin/python3
> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> > > >  - TEST_CMD="make check-acceptance"
> > > >after_failure:
> > > >  - cat tests/results/latest/job.log
> > > > diff --git a/tests/acceptance/boot_linux_console.py
> > > b/tests/acceptance/boot_linux_console.py
> > > > index 3215950..0f638bc 100644
> > > > --- a/tests/acceptance/boot_linux_console.py
> > > > +++ b/tests/acceptance/boot_linux_console.py
> > > > @@ -354,3 +354,69 @@ 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
> > > > +"""
> > > > +deb_url = ('
> https://snapshot.debian.org/archive/debian/'
> > > > +
>  '20190424T171759Z/pool/main/b/binutils/'
> > > > +
> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > > > +deb_hash =
> ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> > > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > > > +objcopy_path = self.extract_from_deb(deb_path,
> objcopy_path)
> > > > +libbfd_path =
> > > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> > > '
> > > > +libbfd_path = self.extract_from_deb(deb_path,
> libbfd_path)
> > > > +process.run('ls -al %s' % (objcopy_path))
> > > > +
> > > > +deb_url = ('
> https://snapshot.debian.org/archive/debian/'
> > > > +   '20190708T032337Z/pool/main/o/opensbi/'
> > > > +   'opensbi_0.4-1_all.deb')
> > > > +deb_hash =
> ('2319dcd702958291d323acf5649fd98a11d90112')
> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> > 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-16 Thread Alistair Francis
On Tue, Jul 16, 2019 at 2:50 PM Philippe Mathieu-Daudé
 wrote:
>
> On 7/16/19 10:43 PM, Alistair Francis wrote:
> > On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao  
> > wrote:
> >>
> >>
> >> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis  
> >> wrote:
> >>>
> >>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
> >>>  wrote:
> 
>  On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> > mailto:phi...@redhat.com>> wrote:
> >
> > On 7/15/19 11:08 AM, 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
> > >
> > > packages
> > >   debian official
> > > binutils-riscv64-linux-gnu_2.32-8
> > > opensbi_0.4-1_all
> > > linux-image-4.19.0-5-riscv64 4.19.37-4
> > >   third-party
> > >
> >  
> > https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > > (the repo is also used in mips target acceptance)
> > >
> > > Signed-off-by: Chih-Min Chao  > >
> > > ---
> > >  .travis.yml|  2 +-
> > >  tests/acceptance/boot_linux_console.py | 66
> > ++
> > >  2 files changed, 67 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/.travis.yml b/.travis.yml
> > > index 5d3d6ee..21fcead 100644
> > > --- a/.travis.yml
> > > +++ b/.travis.yml
> > > @@ -232,7 +232,7 @@ matrix:
> > >
> > >  # Acceptance (Functional) tests
> > >  - env:
> > > -- CONFIG="--python=/usr/bin/python3
> > 
> > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > > +- CONFIG="--python=/usr/bin/python3
> > 
> > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> > >  - TEST_CMD="make check-acceptance"
> > >after_failure:
> > >  - cat tests/results/latest/job.log
> > > diff --git a/tests/acceptance/boot_linux_console.py
> > b/tests/acceptance/boot_linux_console.py
> > > index 3215950..0f638bc 100644
> > > --- a/tests/acceptance/boot_linux_console.py
> > > +++ b/tests/acceptance/boot_linux_console.py
> > > @@ -354,3 +354,69 @@ 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
> > > +"""
> > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > > + '20190424T171759Z/pool/main/b/binutils/'
> > > +
> >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > > +objcopy_path = self.extract_from_deb(deb_path, 
> > objcopy_path)
> > > +libbfd_path =
> > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> > '
> > > +libbfd_path = self.extract_from_deb(deb_path, 
> > libbfd_path)
> > > +process.run('ls -al %s' % (objcopy_path))
> > > +
> > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > > +   '20190708T032337Z/pool/main/o/opensbi/'
> > > +   'opensbi_0.4-1_all.deb')
> > > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > > +'qemu/virt/fw_jump.elf')
> > > +opensbi_path = 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-16 Thread Philippe Mathieu-Daudé
On 7/16/19 10:43 PM, Alistair Francis wrote:
> On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao  wrote:
>>
>>
>> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis  
>> wrote:
>>>
>>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
>>>  wrote:

 On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> mailto:phi...@redhat.com>> wrote:
>
> On 7/15/19 11:08 AM, 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
> >
> > packages
> >   debian official
> > binutils-riscv64-linux-gnu_2.32-8
> > opensbi_0.4-1_all
> > linux-image-4.19.0-5-riscv64 4.19.37-4
> >   third-party
> >
>  
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > (the repo is also used in mips target acceptance)
> >
> > Signed-off-by: Chih-Min Chao  >
> > ---
> >  .travis.yml|  2 +-
> >  tests/acceptance/boot_linux_console.py | 66
> ++
> >  2 files changed, 67 insertions(+), 1 deletion(-)
> >
> > diff --git a/.travis.yml b/.travis.yml
> > index 5d3d6ee..21fcead 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -232,7 +232,7 @@ matrix:
> >
> >  # Acceptance (Functional) tests
> >  - env:
> > -- CONFIG="--python=/usr/bin/python3
> 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > +- CONFIG="--python=/usr/bin/python3
> 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> >  - TEST_CMD="make check-acceptance"
> >after_failure:
> >  - cat tests/results/latest/job.log
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..0f638bc 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,69 @@ 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
> > +"""
> > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > + '20190424T171759Z/pool/main/b/binutils/'
> > +
>  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > +objcopy_path = self.extract_from_deb(deb_path, 
> objcopy_path)
> > +libbfd_path =
> '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> '
> > +libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
> > +process.run('ls -al %s' % (objcopy_path))
> > +
> > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > +   '20190708T032337Z/pool/main/o/opensbi/'
> > +   'opensbi_0.4-1_all.deb')
> > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > +'qemu/virt/fw_jump.elf')
> > +opensbi_path = self.extract_from_deb(deb_path, 
> opensbi_path)
> > +
> > +deb_url =
> ('https://snapshot.debian.org/archive/debian-ports/'
> > +   '20190620T095935Z/pool-riscv64/main/l/linux/'
> > +
>  'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-16 Thread Alistair Francis
On Tue, Jul 16, 2019 at 6:56 AM Chih-Min Chao  wrote:
>
>
> On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis  
> wrote:
>>
>> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
>>  wrote:
>> >
>> > On 7/15/19 1:09 PM, Chih-Min Chao wrote:
>> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
>> > > mailto:phi...@redhat.com>> wrote:
>> > >
>> > > On 7/15/19 11:08 AM, 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
>> > > >
>> > > > packages
>> > > >   debian official
>> > > > binutils-riscv64-linux-gnu_2.32-8
>> > > > opensbi_0.4-1_all
>> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
>> > > >   third-party
>> > > >
>> > >  
>> > > https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
>> > > > (the repo is also used in mips target acceptance)
>> > > >
>> > > > Signed-off-by: Chih-Min Chao > > > >
>> > > > ---
>> > > >  .travis.yml|  2 +-
>> > > >  tests/acceptance/boot_linux_console.py | 66
>> > > ++
>> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
>> > > >
>> > > > diff --git a/.travis.yml b/.travis.yml
>> > > > index 5d3d6ee..21fcead 100644
>> > > > --- a/.travis.yml
>> > > > +++ b/.travis.yml
>> > > > @@ -232,7 +232,7 @@ matrix:
>> > > >
>> > > >  # Acceptance (Functional) tests
>> > > >  - env:
>> > > > -- CONFIG="--python=/usr/bin/python3
>> > > 
>> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
>> > > > +- CONFIG="--python=/usr/bin/python3
>> > > 
>> > > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
>> > > >  - TEST_CMD="make check-acceptance"
>> > > >after_failure:
>> > > >  - cat tests/results/latest/job.log
>> > > > diff --git a/tests/acceptance/boot_linux_console.py
>> > > b/tests/acceptance/boot_linux_console.py
>> > > > index 3215950..0f638bc 100644
>> > > > --- a/tests/acceptance/boot_linux_console.py
>> > > > +++ b/tests/acceptance/boot_linux_console.py
>> > > > @@ -354,3 +354,69 @@ 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
>> > > > +"""
>> > > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
>> > > > + '20190424T171759Z/pool/main/b/binutils/'
>> > > > +
>> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
>> > > > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
>> > > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
>> > > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
>> > > > +objcopy_path = self.extract_from_deb(deb_path, 
>> > > objcopy_path)
>> > > > +libbfd_path =
>> > > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
>> > > '
>> > > > +libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
>> > > > +process.run('ls -al %s' % (objcopy_path))
>> > > > +
>> > > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
>> > > > +   '20190708T032337Z/pool/main/o/opensbi/'
>> > > > +   'opensbi_0.4-1_all.deb')
>> > > > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
>> > > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
>> > > > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
>> > > > +'qemu/virt/fw_jump.elf')
>> > > > +opensbi_path = self.extract_from_deb(deb_path, 
>> > > opensbi_path)
>> > > > +
>> > > > +deb_url =
>> > > ('https://snapshot.debian.org/archive/debian-ports/'
>> > > > +   '20190620T095935Z/pool-riscv64/main/l/linux/'
>> > > > +
>> > >  

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-16 Thread Chih-Min Chao
On Tue, Jul 16, 2019 at 12:34 AM Alistair Francis 
wrote:

> On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
>  wrote:
> >
> > On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> > > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> > > mailto:phi...@redhat.com>> wrote:
> > >
> > > On 7/15/19 11:08 AM, 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
> > > >
> > > > packages
> > > >   debian official
> > > > binutils-riscv64-linux-gnu_2.32-8
> > > > opensbi_0.4-1_all
> > > > linux-image-4.19.0-5-riscv64 4.19.37-4
> > > >   third-party
> > > >
> > >
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > > > (the repo is also used in mips target acceptance)
> > > >
> > > > Signed-off-by: Chih-Min Chao  > > >
> > > > ---
> > > >  .travis.yml|  2 +-
> > > >  tests/acceptance/boot_linux_console.py | 66
> > > ++
> > > >  2 files changed, 67 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/.travis.yml b/.travis.yml
> > > > index 5d3d6ee..21fcead 100644
> > > > --- a/.travis.yml
> > > > +++ b/.travis.yml
> > > > @@ -232,7 +232,7 @@ matrix:
> > > >
> > > >  # Acceptance (Functional) tests
> > > >  - env:
> > > > -- CONFIG="--python=/usr/bin/python3
> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > > > +- CONFIG="--python=/usr/bin/python3
> > >
>  
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> > > >  - TEST_CMD="make check-acceptance"
> > > >after_failure:
> > > >  - cat tests/results/latest/job.log
> > > > diff --git a/tests/acceptance/boot_linux_console.py
> > > b/tests/acceptance/boot_linux_console.py
> > > > index 3215950..0f638bc 100644
> > > > --- a/tests/acceptance/boot_linux_console.py
> > > > +++ b/tests/acceptance/boot_linux_console.py
> > > > @@ -354,3 +354,69 @@ 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
> > > > +"""
> > > > +deb_url = ('https://snapshot.debian.org/archive/debian/
> '
> > > > +
>  '20190424T171759Z/pool/main/b/binutils/'
> > > > +
> > >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > > > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> > > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > > > +objcopy_path = self.extract_from_deb(deb_path,
> objcopy_path)
> > > > +libbfd_path =
> > > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> > > '
> > > > +libbfd_path = self.extract_from_deb(deb_path,
> libbfd_path)
> > > > +process.run('ls -al %s' % (objcopy_path))
> > > > +
> > > > +deb_url = ('https://snapshot.debian.org/archive/debian/
> '
> > > > +   '20190708T032337Z/pool/main/o/opensbi/'
> > > > +   'opensbi_0.4-1_all.deb')
> > > > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> > > > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > > > +'qemu/virt/fw_jump.elf')
> > > > +opensbi_path = self.extract_from_deb(deb_path,
> opensbi_path)
> > > > +
> > > > +deb_url =
> > > ('https://snapshot.debian.org/archive/debian-ports/'
> > > > +   '20190620T095935Z/pool-riscv64/main/l/linux/'
> > > > +
> > >  'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')
> > > > +deb_hash = ('bf5b5680c41d92134d22caef4fbd277c5217e1f0')
> > > > +deb_path = self.fetch_asset(deb_url,
> asset_hash=deb_hash)
> > > > 

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-15 Thread Alistair Francis
On Mon, Jul 15, 2019 at 6:02 AM Philippe Mathieu-Daudé
 wrote:
>
> On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> > On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> > mailto:phi...@redhat.com>> wrote:
> >
> > On 7/15/19 11:08 AM, 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
> > >
> > > packages
> > >   debian official
> > > binutils-riscv64-linux-gnu_2.32-8
> > > opensbi_0.4-1_all
> > > linux-image-4.19.0-5-riscv64 4.19.37-4
> > >   third-party
> > >
> >  
> > https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > > (the repo is also used in mips target acceptance)
> > >
> > > Signed-off-by: Chih-Min Chao  > >
> > > ---
> > >  .travis.yml|  2 +-
> > >  tests/acceptance/boot_linux_console.py | 66
> > ++
> > >  2 files changed, 67 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/.travis.yml b/.travis.yml
> > > index 5d3d6ee..21fcead 100644
> > > --- a/.travis.yml
> > > +++ b/.travis.yml
> > > @@ -232,7 +232,7 @@ matrix:
> > >
> > >  # Acceptance (Functional) tests
> > >  - env:
> > > -- CONFIG="--python=/usr/bin/python3
> > 
> > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > > +- CONFIG="--python=/usr/bin/python3
> > 
> > --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> > >  - TEST_CMD="make check-acceptance"
> > >after_failure:
> > >  - cat tests/results/latest/job.log
> > > diff --git a/tests/acceptance/boot_linux_console.py
> > b/tests/acceptance/boot_linux_console.py
> > > index 3215950..0f638bc 100644
> > > --- a/tests/acceptance/boot_linux_console.py
> > > +++ b/tests/acceptance/boot_linux_console.py
> > > @@ -354,3 +354,69 @@ 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
> > > +"""
> > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > > + '20190424T171759Z/pool/main/b/binutils/'
> > > +
> >  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > > +objcopy_path = self.extract_from_deb(deb_path, objcopy_path)
> > > +libbfd_path =
> > '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> > '
> > > +libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
> > > +process.run('ls -al %s' % (objcopy_path))
> > > +
> > > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > > +   '20190708T032337Z/pool/main/o/opensbi/'
> > > +   'opensbi_0.4-1_all.deb')
> > > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > > +'qemu/virt/fw_jump.elf')
> > > +opensbi_path = self.extract_from_deb(deb_path, opensbi_path)
> > > +
> > > +deb_url =
> > ('https://snapshot.debian.org/archive/debian-ports/'
> > > +   '20190620T095935Z/pool-riscv64/main/l/linux/'
> > > +
> >  'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')
> > > +deb_hash = ('bf5b5680c41d92134d22caef4fbd277c5217e1f0')
> > > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > > +kernel_path = '/boot/vmlinux-4.19.0-5-riscv64'
> > > +kernel_path = self.extract_from_deb(deb_path, kernel_path)
> > > +kimage_path = self.workdir + "/Image"
> > > +env = os.environ
> > > +

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-15 Thread Philippe Mathieu-Daudé
On 7/15/19 1:09 PM, Chih-Min Chao wrote:
> On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé
> mailto:phi...@redhat.com>> wrote:
> 
> On 7/15/19 11:08 AM, 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
> >
> > packages
> >   debian official
> >     binutils-riscv64-linux-gnu_2.32-8
> >     opensbi_0.4-1_all
> >     linux-image-4.19.0-5-riscv64 4.19.37-4
> >   third-party
> >   
>  https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> >     (the repo is also used in mips target acceptance)
> >
> > Signed-off-by: Chih-Min Chao  >
> > ---
> >  .travis.yml                            |  2 +-
> >  tests/acceptance/boot_linux_console.py | 66
> ++
> >  2 files changed, 67 insertions(+), 1 deletion(-)
> >
> > diff --git a/.travis.yml b/.travis.yml
> > index 5d3d6ee..21fcead 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -232,7 +232,7 @@ matrix:
> > 
> >      # Acceptance (Functional) tests
> >      - env:
> > -        - CONFIG="--python=/usr/bin/python3
> 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > +        - CONFIG="--python=/usr/bin/python3
> 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> >          - TEST_CMD="make check-acceptance"
> >        after_failure:
> >          - cat tests/results/latest/job.log
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..0f638bc 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,69 @@ 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
> > +        """
> > +        deb_url = ('https://snapshot.debian.org/archive/debian/'
> > +                         '20190424T171759Z/pool/main/b/binutils/'
> > +                       
>  'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > +        deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +        objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > +        objcopy_path = self.extract_from_deb(deb_path, objcopy_path)
> > +        libbfd_path =
> '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> '
> > +        libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
> > +        process.run('ls -al %s' % (objcopy_path))
> > +
> > +        deb_url = ('https://snapshot.debian.org/archive/debian/'
> > +                   '20190708T032337Z/pool/main/o/opensbi/'
> > +                   'opensbi_0.4-1_all.deb')
> > +        deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +        opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > +                        'qemu/virt/fw_jump.elf')
> > +        opensbi_path = self.extract_from_deb(deb_path, opensbi_path)
> > +
> > +        deb_url =
> ('https://snapshot.debian.org/archive/debian-ports/'
> > +                   '20190620T095935Z/pool-riscv64/main/l/linux/'
> > +                 
>  'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')
> > +        deb_hash = ('bf5b5680c41d92134d22caef4fbd277c5217e1f0')
> > +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +        kernel_path = '/boot/vmlinux-4.19.0-5-riscv64'
> > +        kernel_path = self.extract_from_deb(deb_path, kernel_path)
> > +        kimage_path = self.workdir + "/Image"
> > +        env = os.environ
> > +        env['LD_LIBRARY_PATH'] = ('%s:' %
> (os.path.dirname(libbfd_path)) +
> > +                                 env.get('LD_LIBRARY_PATH', ''))
> > +        process.run(('%s -O binary -O binary -R'
> > +                

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-15 Thread Chih-Min Chao
On Mon, Jul 15, 2019 at 5:15 PM Philippe Mathieu-Daudé 
wrote:

> On 7/15/19 11:08 AM, 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
> >
> > packages
> >   debian official
> > binutils-riscv64-linux-gnu_2.32-8
> > opensbi_0.4-1_all
> > linux-image-4.19.0-5-riscv64 4.19.37-4
> >   third-party
> >
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> > (the repo is also used in mips target acceptance)
> >
> > Signed-off-by: Chih-Min Chao 
> > ---
> >  .travis.yml|  2 +-
> >  tests/acceptance/boot_linux_console.py | 66
> ++
> >  2 files changed, 67 insertions(+), 1 deletion(-)
> >
> > diff --git a/.travis.yml b/.travis.yml
> > index 5d3d6ee..21fcead 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -232,7 +232,7 @@ matrix:
> >
> >  # Acceptance (Functional) tests
> >  - env:
> > -- CONFIG="--python=/usr/bin/python3
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> > +- CONFIG="--python=/usr/bin/python3
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
> >  - TEST_CMD="make check-acceptance"
> >after_failure:
> >  - cat tests/results/latest/job.log
> > diff --git a/tests/acceptance/boot_linux_console.py
> b/tests/acceptance/boot_linux_console.py
> > index 3215950..0f638bc 100644
> > --- a/tests/acceptance/boot_linux_console.py
> > +++ b/tests/acceptance/boot_linux_console.py
> > @@ -354,3 +354,69 @@ 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
> > +"""
> > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > + '20190424T171759Z/pool/main/b/binutils/'
> > + 'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> > +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> > +objcopy_path = self.extract_from_deb(deb_path, objcopy_path)
> > +libbfd_path = '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so
> '
> > +libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
> > +process.run('ls -al %s' % (objcopy_path))
> > +
> > +deb_url = ('https://snapshot.debian.org/archive/debian/'
> > +   '20190708T032337Z/pool/main/o/opensbi/'
> > +   'opensbi_0.4-1_all.deb')
> > +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> > +'qemu/virt/fw_jump.elf')
> > +opensbi_path = self.extract_from_deb(deb_path, opensbi_path)
> > +
> > +deb_url = ('https://snapshot.debian.org/archive/debian-ports/'
> > +   '20190620T095935Z/pool-riscv64/main/l/linux/'
> > +   'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')
> > +deb_hash = ('bf5b5680c41d92134d22caef4fbd277c5217e1f0')
> > +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> > +kernel_path = '/boot/vmlinux-4.19.0-5-riscv64'
> > +kernel_path = self.extract_from_deb(deb_path, kernel_path)
> > +kimage_path = self.workdir + "/Image"
> > +env = os.environ
> > +env['LD_LIBRARY_PATH'] = ('%s:' %
> (os.path.dirname(libbfd_path)) +
> > + env.get('LD_LIBRARY_PATH', ''))
> > +process.run(('%s -O binary -O binary -R'
> > + '.note -R .note.gnu.build-id -R .comment -S %s
> %s') %
> > + (objcopy_path, kernel_path, kimage_path))
>
> Please explain why you need to do that...
>
> Also note these tests are run on other host architecture than x86, at
> least ppc64/s390x (so this won't work there).
>
> it is because riscv64 vmlinux doesn't have physical loading address
information and
depends on certain stage bootloader to move kernel raw data to specific
physical address (0x8020_)

The vmlinux program headers are
  Type Offset   

Re: [Qemu-devel] [PATCH v2] tests/boot_linux_console: add a test for riscv64 + virt

2019-07-15 Thread Philippe Mathieu-Daudé
On 7/15/19 11:08 AM, 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
> 
> packages
>   debian official
> binutils-riscv64-linux-gnu_2.32-8
> opensbi_0.4-1_all
> linux-image-4.19.0-5-riscv64 4.19.37-4
>   third-party
> https://github.com/groeck/linux-build-test/rootfs/riscv64/rootfs.cpio.gz
> (the repo is also used in mips target acceptance)
> 
> Signed-off-by: Chih-Min Chao 
> ---
>  .travis.yml|  2 +-
>  tests/acceptance/boot_linux_console.py | 66 
> ++
>  2 files changed, 67 insertions(+), 1 deletion(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 5d3d6ee..21fcead 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -232,7 +232,7 @@ matrix:
>  
>  # Acceptance (Functional) tests
>  - env:
> -- CONFIG="--python=/usr/bin/python3 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu"
> +- CONFIG="--python=/usr/bin/python3 
> --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,riscv64-softmmu"
>  - TEST_CMD="make check-acceptance"
>after_failure:
>  - cat tests/results/latest/job.log
> diff --git a/tests/acceptance/boot_linux_console.py 
> b/tests/acceptance/boot_linux_console.py
> index 3215950..0f638bc 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -354,3 +354,69 @@ 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
> +"""
> +deb_url = ('https://snapshot.debian.org/archive/debian/'
> + '20190424T171759Z/pool/main/b/binutils/'
> + 'binutils-riscv64-linux-gnu_2.32-8_amd64.deb')
> +deb_hash = ('7fe376fd4452696c03acd508d6d613ca553ea15e')
> +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +objcopy_path = '/usr/bin/riscv64-linux-gnu-objcopy'
> +objcopy_path = self.extract_from_deb(deb_path, objcopy_path)
> +libbfd_path = '/usr/lib/x86_64-linux-gnu/libbfd-2.32-riscv64.so'
> +libbfd_path = self.extract_from_deb(deb_path, libbfd_path)
> +process.run('ls -al %s' % (objcopy_path))
> +
> +deb_url = ('https://snapshot.debian.org/archive/debian/'
> +   '20190708T032337Z/pool/main/o/opensbi/'
> +   'opensbi_0.4-1_all.deb')
> +deb_hash = ('2319dcd702958291d323acf5649fd98a11d90112')
> +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +opensbi_path = ('/usr/lib/riscv64-linux-gnu/opensbi/'
> +'qemu/virt/fw_jump.elf')
> +opensbi_path = self.extract_from_deb(deb_path, opensbi_path)
> +
> +deb_url = ('https://snapshot.debian.org/archive/debian-ports/'
> +   '20190620T095935Z/pool-riscv64/main/l/linux/'
> +   'linux-image-4.19.0-5-riscv64_4.19.37-4_riscv64.deb')
> +deb_hash = ('bf5b5680c41d92134d22caef4fbd277c5217e1f0')
> +deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +kernel_path = '/boot/vmlinux-4.19.0-5-riscv64'
> +kernel_path = self.extract_from_deb(deb_path, kernel_path)
> +kimage_path = self.workdir + "/Image"
> +env = os.environ
> +env['LD_LIBRARY_PATH'] = ('%s:' % (os.path.dirname(libbfd_path)) +
> + env.get('LD_LIBRARY_PATH', ''))
> +process.run(('%s -O binary -O binary -R'
> + '.note -R .note.gnu.build-id -R .comment -S %s %s') %
> + (objcopy_path, kernel_path, kimage_path))

Please explain why you need to do that...

Also note these tests are run on other host architecture than x86, at
least ppc64/s390x (so this won't work there).

> +
> +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
> +