[libvirt PATCH 4/4] gitlab-ci: Introduce a new test 'integration' pipeline stage

Daniel P. Berrangé berrange at redhat.com
Tue Feb 22 14:33:48 UTC 2022


On Thu, Feb 17, 2022 at 09:54:12AM -0800, Andrea Bolognani wrote:
> On Mon, Jan 31, 2022 at 07:01:01PM +0100, Erik Skultety wrote:
> > +++ b/.gitlab-ci-integration.yml
> > @@ -0,0 +1,116 @@
> > +.tests:
> > +  stage: integration
> > +  before_script:
> > +    - mkdir "$SCRATCH_DIR"
> > +    - sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/*
> > +    - sudo pip3 install --prefix=/usr avocado-framework
> > +    - source /etc/os-release  # in order to query the vendor-provided variables
> > +    - if test "$ID" == "centos" && test "$VERSION_ID" -lt 9 ||
> > +         test "$ID" == "fedora" && test "$VERSION_ID" -lt 35;
> 
> Using == with test is a bashism, please stick to the portable version
> even though it's very likely that the script will ultimately run
> under bash.
> 
> > +    - for daemon in $DAEMONS;
> > +      do
> > +        sudo sed -Ei "s/^(#)?(log_outputs=).*/\2'1:file:\/var\/log\/libvirt\/${daemon}.log'/" /etc/libvirt/${daemon}.conf;
> > +        sudo sed -Ei "s/^(#)?(log_filters=).*/\2'4:*object* 4:*json* 4:*event* 4:*rpc* 4:daemon.remote 4:util.threadjob 4:*access* 1:*'/" /etc/libvirt/${daemon}.conf;
> > +        sudo systemctl --quiet stop ${daemon}.service;
> > +        sudo systemctl restart ${daemon}.socket;
> > +      done
> 
> I suggest changing this to something along the lines of
> 
>   - for daemon in $DAEMONS;
>     do
>       log_outputs="file:/var/log/libvirt/${daemon}.log"
>       log_filters="3:remote 4:event 3:util.json 3:util.object
> 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*"
>       sed -Ei -e "s;^#*\\s*log_outputs\\s*=.*$;log_outputs=\"$log_outputs\";g" \
>               -e "s;^#*\\s*log_filters\\s*=.*$;log_filters=\"$log_filters\";g" \
>               "src/remote/${daemon}.conf.in"
>       # ...
>     done

I'd suggest simply not using sed at all

   - for daemon in $DAEMONS;
     do
       log_outputs="file:/var/log/libvirt/${daemon}.log"
       log_filters="3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*"
       augtool set /files/etc/libvirt/${daemon}.conf/log_filters "$log_filters"
       augtool set /files/etc/libvirt/${daemon}.conf/log_outputs "$log_outputs"
     done



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list