[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 4/4] travis.yml: Enable acceptance KVM tests
From: |
Thomas Huth |
Subject: |
Re: [PATCH v3 4/4] travis.yml: Enable acceptance KVM tests |
Date: |
Mon, 27 Jan 2020 10:34:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 24/01/2020 22.15, Wainer dos Santos Moschetta wrote:
>
> On 1/22/20 7:22 AM, Thomas Huth wrote:
>> On 22/01/2020 02.27, Wainer dos Santos Moschetta wrote:
>>> Some acceptance tests require KVM or they are skipped. Travis
>>> enables nested virtualization by default with Ubuntu
>>> 18.04 (Bionic) on x86_64. So in order to run the kvm tests, this
>>> changed the acceptance builder to run in a Bionic VM. Also
>>> it was needed to ensure the current user has rw permission
>>> to /dev/kvm.
>>>
>>> Signed-off-by: Wainer dos Santos Moschetta <address@hidden>
>>> ---
>>> .travis.yml | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/.travis.yml b/.travis.yml
>>> index 6c1038a0f1..c3edd0a907 100644
>>> --- a/.travis.yml
>>> +++ b/.travis.yml
>>> @@ -2,6 +2,7 @@
>>> # Additional builds with specific requirements for a full VM need to
>>> # be added as additional matrix: entries later on
>>> dist: xenial
>>> +sudo: true
>>> language: c
>>> compiler:
>>> - gcc
>>> @@ -83,6 +84,9 @@ git:
>>> before_script:
>>> - if command -v ccache ; then ccache --zero-stats ; fi
>>> + - if [[ -e /dev/kvm ]] && ! [[ -r /dev/kvm && -w /dev/kvm ]]; then
>> By the way, in case you respin, could you please use singel "[" instead
>> of "[[" ... since that's what we use in almost all other shell
>> scripts, too.
>
> Like this? ->
>
> if [ -e /dev/kvm ] && [ ! -r /dev/kvm ] || [ ! -w /dev/kvm ]; then
If I get the man-page of bash right, && and || have equal precedence ...
so I'd maybe rather write it as:
if [ -e /dev/kvm ]; then if [ ! -r /dev/kvm ] || [ ! -w /dev/kvm ]; ...
... ok, this is getting uglier ...maybe it's better to rather stick with
your original code...?
Thomas
PS: You could also use -c instead -e in the first test.
[PATCH v3 3/4] tests/acceptance: avocado_qemu: Refactor the handler of 'machine' parameter, Wainer dos Santos Moschetta, 2020/01/21
[PATCH v3 4/4] travis.yml: Enable acceptance KVM tests, Wainer dos Santos Moschetta, 2020/01/21
Re: [PATCH v3 4/4] travis.yml: Enable acceptance KVM tests, Philippe Mathieu-Daudé, 2020/01/24