[v2,3/4] CI: install qemu-system when qemu testing is requested

Message ID 20230112235929.1437-4-henning.schild@siemens.com
State Superseded, archived
Headers show
Series CI rework of gitlab fast job | expand

Commit Message

Henning Schild Jan. 12, 2023, 11:59 p.m. UTC
And also change gitlab ci config to request qemu testing.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 .gitlab-ci.yml      | 2 +-
 scripts/ci_build.sh | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Uladzimir Bely Jan. 14, 2023, 8:15 p.m. UTC | #1
In the email from Friday, 13 January 2023 02:59:28 +03 user Henning Schild 
wrote:
> And also change gitlab ci config to request qemu testing.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  .gitlab-ci.yml      | 2 +-
>  scripts/ci_build.sh | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index fcdefa87bf66..dc8a01b9d1d6 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -27,7 +27,7 @@ fast-ci:
>    except:
>      - schedules
>    script:
> -    - scripts/ci_build.sh -q -f -n
> +    - scripts/ci_build.sh -q -f
> 
>  full-ci:
>    <<: *common-build
> diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
> index e5f20d4f0a1f..1704ec17af89 100755
> --- a/scripts/ci_build.sh
> +++ b/scripts/ci_build.sh
> @@ -127,6 +127,11 @@ fi
> 
>  if [ -n "$NORUN" ]; then
>      TAGS="$TAGS,-startvm"
> +else
> +    if ! command -v qemu-system-x86 > /dev/null; then
> +        sudo apt-get update -qq
> +        sudo apt-get install -y qemu-system

This seems to be incorrect. In our CI chroot we have `qemu-system-x86_64` and 
`/usr/bin/qemu-system-i386` (among other archs), but not `-x86` one. So, the 
check always fails and apt-get is always called (with "qemu-system is already 
the newest version" message from apt).

> +    fi
>  fi
> 
>  # Provide working path
Henning Schild Jan. 23, 2023, 8:51 a.m. UTC | #2
Am Sat, 14 Jan 2023 23:15:54 +0300
schrieb Uladzimir Bely <ubely@ilbers.de>:

> In the email from Friday, 13 January 2023 02:59:28 +03 user Henning
> Schild wrote:
> > And also change gitlab ci config to request qemu testing.
> > 
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >  .gitlab-ci.yml      | 2 +-
> >  scripts/ci_build.sh | 5 +++++
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index fcdefa87bf66..dc8a01b9d1d6 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -27,7 +27,7 @@ fast-ci:
> >    except:
> >      - schedules
> >    script:
> > -    - scripts/ci_build.sh -q -f -n
> > +    - scripts/ci_build.sh -q -f
> > 
> >  full-ci:
> >    <<: *common-build
> > diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
> > index e5f20d4f0a1f..1704ec17af89 100755
> > --- a/scripts/ci_build.sh
> > +++ b/scripts/ci_build.sh
> > @@ -127,6 +127,11 @@ fi
> > 
> >  if [ -n "$NORUN" ]; then
> >      TAGS="$TAGS,-startvm"
> > +else
> > +    if ! command -v qemu-system-x86 > /dev/null; then
> > +        sudo apt-get update -qq
> > +        sudo apt-get install -y qemu-system  
> 
> This seems to be incorrect. In our CI chroot we have
> `qemu-system-x86_64` and `/usr/bin/qemu-system-i386` (among other
> archs), but not `-x86` one. So, the check always fails and apt-get is
> always called (with "qemu-system is already the newest version"
> message from apt).

Right. I will switch this over to testing for "qemu-system-x86_64" but
still install "all qemus" with the meta package "qemu-system".

Or maybe "test -f /usr/share/doc/qemu-system/copyright" to check for
that meta-package.

Strictly speaking we do not need all of the qemus, but maintaining the
list of our arches seems too much effort.

Henning

> 
> > +    fi
> >  fi
> > 
> >  # Provide working path  
> 
> 
> 
>
Anton Mikanovich Jan. 24, 2023, 8:53 p.m. UTC | #3
23/01/2023 10:51, Henning Schild wrote:
> Right. I will switch this over to testing for "qemu-system-x86_64" but
> still install "all qemus" with the meta package "qemu-system".
>
> Or maybe "test -f /usr/share/doc/qemu-system/copyright" to check for
> that meta-package.
>
> Strictly speaking we do not need all of the qemus, but maintaining the
> list of our arches seems too much effort.
>
> Henning

Hello, I've just send '[PATCH v2 00/15] Add developers test' with this 
commit
fixed inside. This is how I see test cases splitting between developers and
maintainers.

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fcdefa87bf66..dc8a01b9d1d6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,7 +27,7 @@  fast-ci:
   except:
     - schedules
   script:
-    - scripts/ci_build.sh -q -f -n
+    - scripts/ci_build.sh -q -f
 
 full-ci:
   <<: *common-build
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index e5f20d4f0a1f..1704ec17af89 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -127,6 +127,11 @@  fi
 
 if [ -n "$NORUN" ]; then
     TAGS="$TAGS,-startvm"
+else
+    if ! command -v qemu-system-x86 > /dev/null; then
+        sudo apt-get update -qq
+        sudo apt-get install -y qemu-system
+    fi
 fi
 
 # Provide working path