[Avocado-devel] Quickstart for users to use avocado framework to run existing tests
Lukáš Doktor
ldoktor at redhat.com
Fri Nov 27 17:36:58 UTC 2015
Dne 27.11.2015 v 09:50 srikanth napsal(a):
> Hi,
>
> Currently to get started off and figure out lets say virttest files
> location it takes a bit of time, not huge though. From my experience as
> end-user so far.. have prepared a real quick start off guide to users
> who would just want to be able to run the existing qemu/libvirt tests
> using avocado.
>
> Requesting your comments on the same. Many thanks for your time in advance.
>
>
>
>
> _______________________________________________
> Avocado-devel mailing list
> Avocado-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/avocado-devel
>
Hello Srikanth,
thank you for sharing it with us, I believe we can integrate some pieces
in the official documentation:
http://avocado-vt.readthedocs.org/en/latest/GetStartedGuide.html
I think the official documentation is quite informative, but it might be
because I'm already familiar with avocado... If I may ask you, please
have a look there and try to come up with suitable places to inject your
pieces, that would be really helpful.
Some nitpicks regarding your file:
>> This document aims to provide you with adequate information which
can help you get started with
>> running existing tests using avocado.
>> What is avocado?
>> Avocado is an improved version of autotest.
>> If you are familiar with autotest framework, below is mapping to
replacement/equivalent in avocado:
>> > autotest test runner is equivalent to avocado test runner
>> > virttest is included in avocado-VT. We generally would be using
this one to write tests until the
>> avocado-virt is more mature.
>> > avocado-virt is Avocado Virtualization Plugin and Library
>> > Tests can also be written under avocado-virt-tests using the
libraries supported by avocado-virt
True, but at this point very dangerous. Machines are even not yet
properly cleaned after each test, so avocado-vt will be with us for a
while... (although with growing community this might change)
>> More info: http://avocado-framework.readthedocs.org/en/latest/
+ the link to avocado-vt docs ;-)
>> How to install avocado?
>> Below link gives information on installing avocado [which is as
simple as rpm install]:
Or apt-get... ;-)
>>
http://avocado-framework.readthedocs.org/en/latest/GetStartedGuide.html#installing-avocado
>> Below are the minimum packages required , which enables running
existing qemu,libvirt testcases as
>> well:
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> •
>> PyYAML
>> aexpect
>> autotest-framework
>> avocado
>> avocado-plugins-vt
>> avocado-virt
>> fabric
>> gdb-gdbserver
>> libtomcrypt
>> libtommath
>> p7zip
>> pystache
>> python-crypto
>> python-ecdsa
>> python-paramiko
>> python3-simplejsonQuickstart to useful avocado commands and key
config/data file locations:
>> 1. List all avocado plugins:
>> avocado plugins
>> 2. Run sample test
>> avocado run /bin/true
>> 3. This command is used to download the latest JeOS image, necessary
to run libvirt,QEMU[and any
>> other which you need] related tests.
The command is used to download the test providers, prepare the
environment and btw even download the JeOS (when you run on supported
platform).
>> avocado virt-bootstrap
>> avocado vt-bootstrap --vt-type qemu
>> avocado vt-bootstrap --vt-type libvirt
>> 4. Once you bootstrap, try to list all testcases:
>> sudo avocado list --vt-type libvirt
>> sudo avocado list --verbose
>> This should list a large amount of tests (over 1900 virt related tests)
>> ACCESS_DENIED: 0
>> BROKEN_SYMLINK: 0
>> EXTERNAL: 0
>> FILTERED: 0
>> INSTRUMENTED: 0
>> MISSING: 0
>> NOT_A_TEST: 0
>> SIMPLE: 0
>> VT: 1922
>> 5. virttest location:
>> /usr/lib/python2.7/site-packages/virttest/
"Usual" virttest location (it can be elsewhere depending on your
configuration)
>> 6. To get the configuration of avocado and default directories:
>> avocado config
>> Avocado config files:
I'd probably say to see the list of used config files, execute `avocado
config`
>> /etc/avocado/avocado.conf
>> /etc/avocado/conf.d/virt.conf
>> /etc/avocado/conf.d/vt.conf
>> /etc/avocado/conf.d/gdb.conf
>> /home/srikanth/.config/avocado/avocado.confAvocado data files:
The same here, `avocado config --datadir`... These locations are heavily
dependent on the user's permissions.
>> datadir.paths.base_dir
>> datadir.paths.test_dir
>> datadir.paths.data_dir
>> datadir.paths.logs_dir
>> /usr/share/avocado
>> /usr/share/avocado/tests
>> /usr/share/avocado/data
>> ~/avocado/job-results
>> 7. Legacy QEMU tests location:
It's worth mentioning that the test location is logged at the beginning
of the test log (after params), for example:
Found subtest module
/home/medic/avocado/data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/generic/tests/boot.py
>>
/usr/share/avocado/data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/qemu/tests
>> 8. Legacy libvirt tests location:
>>
/usr/share/avocado/data/avocado-vt/test-providers.d/downloads/io-github-autotest-
>> libvirt/libvirt/tests/src
>> 9. Running one virt-test to make sure your setup is good enough:
>> avocado run type_specific.io-github-autotest-qemu.migrate.default.tcp
Also for libvirt tests it's probably good to mention you usually need to
import and remove the image (although nowadays avocado prints the
exception with an example, so it's probably not necessary)
More information about the Avocado-devel
mailing list