[Avocado-devel] How to create a custom config image to import and run the tests

chandrpm at codeaurora.org chandrpm at codeaurora.org
Thu Feb 8 15:46:58 UTC 2018


Hi Lukas,

I was able to the custom config file to include the disk.img and import using "unattended_install.import.import.default_install.aio_native".

Is there a way where I can mention the hardware, machine, os and tests in one config file ? 

So that we don't have to manipulate many config files.

Thanks,
Chandrashekar   


-----Original Message-----
From: avocado-devel-bounces at redhat.com [mailto:avocado-devel-bounces at redhat.com] On Behalf Of chandrpm at codeaurora.org
Sent: Wednesday, February 7, 2018 11:52 PM
To: 'Lukáš Doktor' <ldoktor at redhat.com>; avocado-devel at redhat.com
Subject: Re: [Avocado-devel] How to create a custom config image to import and run the tests

Thanks a lot!

Now my setup is completely messed up, probably I would reinstall and try the same.
  
~cshastri

-----Original Message-----
From: Lukáš Doktor [mailto:ldoktor at redhat.com]
Sent: Wednesday, February 7, 2018 11:26 PM
To: chandrpm at codeaurora.org; avocado-devel at redhat.com
Subject: Re: [Avocado-devel] How to create a custom config image to import and run the tests

Dne 7.2.2018 v 18:33 chandrpm at codeaurora.org napsal(a):
> Hi,
> 
> The shared folder is not created when I install the avocado and after 
> running the vt-bootstrap, I manually created the 
> shared/cfg/guest-os/Linux/LinuxCustom/foo.cfg
> 

The shared folder has to be somewhere. When installed from RPM or by `make install` it's usually in `/usr/share/avocado-plugins-vt/shared`, when executed using `make link` (on development machine I'd recommend this) it's directly in the sources `$AVOCADO_VT_SOURCES/share`.

After `vt-bootstrap` those changes should be visible in `$avocado_data_dir/avocado-vt/backends/$provider/cfg/guest-os.cfg` where `$avocado_data_dir` can be found in `avocado config --datadir` and $provider` means the provider you chose via `--vt-type`, by default it's qemu (and I'd recommend starting with this one, it's way easier at first).

> cat shared/cfg/guest-os/Linux/LinuxCustom/foo.cfg
> - FooLinux:
>     image_name = images/foo-linux
>> It doesn't list the foo guest.

Most certainly you created this dir in a wrong location. Once you do that it should work (there is even LinuxCustom readme describing some useful attributes). Anyway I'd recommend using similar existing profile, which should give you better results. Simply pick something with similar init, packaging-app and kernel features and that's it. On the other hand starting fresh with LinuxCustom might avoid some possible wrong assumptions :-) Just keep in mind some tests are tagged `only RHEL` or `no JeOS` which might eliminate them from your `LinuxCustom` execution (there is a great difference in `avocado list` and `avocado list --vt-guest-os RHEL.7.devel` (I like the `RHEL.7.devel` because it generally means any RHEL.7-like system, which is basically any newer Fedora, SuSE, CentOS or even RHEL :D).

Regards,
Lukáš

> 
> Thanks,
> Chandrashekar
> 
> -----Original Message-----
> From: avocado-devel-bounces at redhat.com 
> [mailto:avocado-devel-bounces at redhat.com] On Behalf Of Lukáš Doktor
> Sent: Wednesday, February 7, 2018 9:51 PM
> To: chandrpm at codeaurora.org; avocado-devel at redhat.com
> Subject: Re: [Avocado-devel] How to create a custom config image to 
> import and run the tests
> 
> Dne 31.1.2018 v 16:49 chandrpm at codeaurora.org napsal(a):
>> How to add the user define guest and boot from the existing disk.img 
>> and run the minimal tests, like
>>
>> I don't include migration, nfs, glusterfs, etc.
>>
>> Could you please help me on the same.
>>
>> Thanks,
>> Chandrashekar
>>
> 
> Hello Chandrashekar,
> 
> I assume you're talking about Avocado-vt tests, right? There the disk image is specified by the `--vt-guest-os` "profile" which are defined in `$AVOCADO_VT/shared/cfg/guest-os/*` config files. You can see that there are many values set which change many aspects throughout the test execution mainly about the allowed devices (virtio_blk/virtio_scsi/...) or ways to interact with os (yum, apt-get, whatever windows allows...), but many things are common even across different profiles.
> 
> So, to answer your question, simply find the closest match either by looking through the files or using `avocado list --vt-list-guests` (probably combined with `--vt-arch aarch64 --vt-machine-type arm64-pci`) which lists the profiles available for given arch/machine-type. Note that differences between architectures are usually quite small so if need for example `debian` you can copy the `x86_64` profile and change the values that are defined there and it should "mainly" work. Keep in mind you have to run `avocado vt-bootstrap` to propagate the changes in `$AVOCADO_VT/shared` to Avocado-vt.
> 
> Once you pick a suitable profile you can simply run `avocado --show all run --vt-guest-os XXX -- boot` which will most probably fail saying "image /foo/bar/baz/XXX.qcow2 not found" which gives you the location where you need to put your image. Once the image is there Avocado will assume it's the correct image of that OS, it'll create a backup and use it in tests usually reverting back after testing. There are some exceptions where the image gets overridden and that are mainly the `unattended_install` tests which try to install that kind of OS using the chosen media (cdrom, url, ...).
> 
> Note that for start you should be able to use the default, which is `JeOS.27` which is essentially a stripped out Fedora 27 shipped by us for all main architectures (aarch64, ppc64, ppc64le, x86_64 and s390x) so `avocado run boot` should usually work.
> 
> Happy testing,
> Lukáš
> 
> 









More information about the Avocado-devel mailing list