[Avocado-devel] Avocado related questions

Cleber Rosa crosa at redhat.com
Tue Feb 26 21:32:17 UTC 2019



----- Original Message -----
> From: "Junchao Zhang" <zhangjckimi at gmail.com>
> To: "Cleber Rosa" <crosa at redhat.com>
> Cc: "Lukáš Doktor" <ldoktor at redhat.com>, avocado-devel at redhat.com
> Sent: Tuesday, February 26, 2019 3:47:20 PM
> Subject: Re: [Avocado-devel] Avocado related questions
> 
> HI Cleber,
> 
> Here is some problem:
> I cannot see anything when I ran the command:
> >>> pkg_resources.get_entry_map(dist)
> {}
> 

As I suspected, there are no entry points... These are usually in a (generated)
file called "entry_points.txt", inside a "dist-info" or ".egg/EGG-INFO" directory
(depending on versions and installation methods).

These are usually created by setup.py/pip, etc.  You should double check if
you're also copying all of those generated files to the "kindle" system.

But, this is just a guess, I have never installed on one system and attempted
to run on another one.

Regards,
- Cleber.

> Thanks,
> Junchao
> 
> On Tue, Feb 26, 2019 at 11:37 AM Cleber Rosa <crosa at redhat.com> wrote:
> 
> >
> >
> > ----- Original Message -----
> > > From: "Junchao Zhang" <zhangjckimi at gmail.com>
> > > To: "Cleber Rosa" <crosa at redhat.com>
> > > Cc: "Lukáš Doktor" <ldoktor at redhat.com>, avocado-devel at redhat.com
> > > Sent: Tuesday, February 26, 2019 2:23:39 PM
> > > Subject: Re: [Avocado-devel] Avocado related questions
> > >
> > > Hi Cleber,
> > >
> > > Here is the output:
> > > >>> import pkg_resources
> > > >>> pkg_resources.get_distribution('avocado-framework')
> > > avocado-framework 68.0
> > > (/mnt/us/testutils/python/lib/python2.7/site-packages)
> > >
> > > [root at kindle scripts]# cd
> > > /mnt/us/testutils/python/lib/python2.7/site-packages
> > > [root at kindle site-packages]# find . -name "avocado*-info"
> > > ./avocado_framework-68.0-py2.7.egg-info
> > >
> > > I did not see something like *.dist-info in this folder.
> > >
> >
> > OK, but the 'egg-info' should be just as good (different
> > installation methods produce different ".info" dirs).
> >
> > Could you please try:
> >
> >    >>> dist = pkg_resources.get_distribution('avocado-framework')
> >    >>> pkg_resources.get_entry_map(dist)
> >
> > On my system it shows (beautified):
> >
> > {'avocado.plugins.cli': {'envkeep': EntryPoint.parse('envkeep =
> > avocado.plugins.envkeep:EnvKeep'),
> >                          'gdb': EntryPoint.parse('gdb =
> > avocado.plugins.gdb:GDB'),
> >                          'journal': EntryPoint.parse('journal =
> > avocado.plugins.journal:Journal'),
> >                          'json': EntryPoint.parse('json =
> > avocado.plugins.jsonresult:JSONCLI'),
> >                          'json_variants': EntryPoint.parse('json_variants
> > = avocado.plugins.json_variants:JsonVariantsCLI'),
> >                          'replay': EntryPoint.parse('replay =
> > avocado.plugins.replay:Replay'),
> >                          'tap': EntryPoint.parse('tap =
> > avocado.plugins.tap:TAP'),
> >                          'wrapper': EntryPoint.parse('wrapper =
> > avocado.plugins.wrapper:Wrapper'),
> >                          'xunit': EntryPoint.parse('xunit =
> > avocado.plugins.xunit:XUnitCLI'),
> >                          'zip_archive': EntryPoint.parse('zip_archive =
> > avocado.plugins.archive:ArchiveCLI')},
> >  'avocado.plugins.cli.cmd': {'config': EntryPoint.parse('config =
> > avocado.plugins.config:Config'),
> >                              'diff': EntryPoint.parse('diff =
> > avocado.plugins.diff:Diff'),
> >                              'distro': EntryPoint.parse('distro =
> > avocado.plugins.distro:Distro'),
> >                              'exec-path': EntryPoint.parse('exec-path =
> > avocado.plugins.exec_path:ExecPath'),
> >                              'list': EntryPoint.parse('list =
> > avocado.plugins.list:List'),
> >                              'multiplex': EntryPoint.parse('multiplex =
> > avocado.plugins.multiplex:Multiplex'),
> >                              'plugins': EntryPoint.parse('plugins =
> > avocado.plugins.plugins:Plugins'),
> >                              'run': EntryPoint.parse('run =
> > avocado.plugins.run:Run'),
> >                              'sysinfo': EntryPoint.parse('sysinfo =
> > avocado.plugins.sysinfo:SysInfo'),
> >                              'variants': EntryPoint.parse('variants =
> > avocado.plugins.variants:Variants')},
> >  'avocado.plugins.job.prepost': {'human': EntryPoint.parse('human =
> > avocado.plugins.human:HumanJob'),
> >                                  'jobscripts':
> > EntryPoint.parse('jobscripts = avocado.plugins.jobscripts:JobScripts'),
> >                                  'teststmpdir':
> > EntryPoint.parse('teststmpdir = avocado.plugins.teststmpdir:TestsTmpDir')},
> >  'avocado.plugins.result': {'json': EntryPoint.parse('json =
> > avocado.plugins.jsonresult:JSONResult'),
> >                             'xunit': EntryPoint.parse('xunit =
> > avocado.plugins.xunit:XUnitResult'),
> >                             'zip_archive': EntryPoint.parse('zip_archive =
> > avocado.plugins.archive:Archive')},
> >  'avocado.plugins.result_events': {'human': EntryPoint.parse('human =
> > avocado.plugins.human:Human'),
> >                                    'journal': EntryPoint.parse('journal =
> > avocado.plugins.journal:JournalResult'),
> >                                    'tap': EntryPoint.parse('tap =
> > avocado.plugins.tap:TAPResult')},
> >  'avocado.plugins.varianter': {'json_variants':
> > EntryPoint.parse('json_variants =
> > avocado.plugins.json_variants:JsonVariants')}}
> >
> >
> > FIY, the available commands come from the avocado.plugins.cli.cmd key.
> >
> > Regards,
> > - Cleber.
> >
> >
> > > Thanks,
> > > Junchao
> > >
> > > On Tue, Feb 26, 2019 at 11:14 AM Cleber Rosa <crosa at redhat.com> wrote:
> > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > > From: "Junchao Zhang" <zhangjckimi at gmail.com>
> > > > > To: "Lukáš Doktor" <ldoktor at redhat.com>
> > > > > Cc: avocado-devel at redhat.com
> > > > > Sent: Tuesday, February 26, 2019 1:38:40 PM
> > > > > Subject: Re: [Avocado-devel] Avocado related questions
> > > > >
> > > > > Hi Lukas,
> > > > >
> > > > > Here is some update:
> > > > > I replace the setuptools with a new one and reran "python setup.py
> > > > > install". I have attached the output below. Everything looks great.
> > But
> > > > > after the installation, when I execute
> > /mnt/us/avocado/scripts/avocado,
> > > > > there is still not options for valid subcommands:
> > > > > [root at kindle scripts]# python avocado run
> > > > > ***
> > > > > subcommands:
> > > > >   valid subcommands
> > > > >
> > > > >   {}                    subcommand help
> > > > >
> > > > > avocado: error: argument subcommand: invalid choice: 'run' (choose
> > from )
> > > > >
> > > >
> > > > Hi Junchao,
> > > >
> > > > Getting a bit more "under the hood", could you please open a Python
> > > > interpreter
> > > > on your kindle system and execute:
> > > >
> > > >    >>> import pkg_resources
> > > >    >>> pkg_resources.get_distribution('avocado-framework')
> > > >
> > > > It should return something like:
> > > >
> > > >    avocado-framework 68.0 (/tmp/venv/lib/python3.7/site-packages)
> > > >
> > > > Then, in the directory given under parenthesis, there should be a
> > directory
> > > > named after the "distribution" name, and ending in   In this case:
> > > >
> > > >
> > /tmp/venv/lib/python3.7/site-packages/avocado_framework-68.0.dist-info
> > > >
> > > > Can you please check if this directory exists, and if you have a
> > content
> > > > similar to:
> > > >
> > > >    $ ls
> > > > /tmp/venv/lib/python3.7/site-packages/avocado_framework-68.0.dist-info
> > > >    entry_points.txt  INSTALLER  METADATA  RECORD  top_level.txt  WHEEL
> > > >
> > > > Thanks,
> > > > - Cleber.
> > > >
> > > > > Thanks,
> > > > > Junchao
> > > > >
> > > > > On Tue, Feb 26, 2019 at 9:47 AM Junchao Zhang <zhangjckimi at gmail.com
> > >
> > > > wrote:
> > > > >
> > > > > > Hi Lukas,
> > > > > >
> > > > > > I am using Kindle which is armv7l. There is no "pip" on this
> > server.
> > > > What
> > > > > > I did is I directly copy the setuptools package from my x86_64
> > Ubuntu
> > > > and
> > > > > > removed all the .pyc files in the package. The setuptools work
> > fine on
> > > > my
> > > > > > x86_64 server. We want to keep the system clean so probably cannot
> > > > install
> > > > > > "pip" on the server. Do you have any solution for this situation?
> > > > > >
> > > > > > Thanks,
> > > > > > Junchao
> > > > > >
> > > > > > On Mon, Feb 25, 2019 at 11:51 PM Lukáš Doktor <ldoktor at redhat.com>
> > > > wrote:
> > > > > >
> > > > > >> Dne 26. 02. 19 v 2:46 Junchao Zhang napsal(a):
> > > > > >> > HI Lukas,
> > > > > >> >
> > > > > >> > Thanks for your explanation. My situation is I am trying to use
> > > > Avocado
> > > > > >> on my arm server.
> > > > > >> > When I ran 'python setup.py install', it had the following
> > output:
> > > > > >> >
> > > > > >> > [root at kindle avocado]# python setup.py install
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'entry_points'
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'zip_safe'
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'include_package_data'
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'python_requires'
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'install_requires'
> > > > > >> > /mnt/us/testutils/python/lib/python2.7/distutils/dist.py:267:
> > > > > >> UserWarning: Unknown distribution option: 'test_suite'
> > > > > >>
> > > > > >> Hello Kimi,
> > > > > >>
> > > > > >> this looks like old setuptools. What version are you using? Can
> > you
> > > > > >> please provide the output of `pip list` to see the installed
> > > > libraries?
> > > > > >> Also if `setuptools` is not listed, you should install it (or try
> > > > updating
> > > > > >> it). Currently I'm using "setuptools==40.4.3".
> > > > > >>
> > > > > >> What could also help is knowing what distribution are you working
> > on.
> > > > I'm
> > > > > >> running avocado jobs on aarch64 on RHEL7 and RHEL8 and it works
> > like a
> > > > > >> charm.
> > > > > >>
> > > > > >> Regards,
> > > > > >> Lukáš
> > > > > >>
> > > > > >> > running install
> > > > > >> > running build
> > > > > >> > running build_py
> > > > > >> > running build_scripts
> > > > > >> > running install_lib
> > > > > >> > running install_scripts
> > > > > >> > changing mode of /mnt/us/testutils/python/bin/avocado to 777
> > > > > >> > changing mode of
> > /mnt/us/testutils/python/bin/avocado-rest-client
> > > > to 777
> > > > > >> > running install_egg_info
> > > > > >> > Removing
> > > > > >>
> > > >
> > /mnt/us/testutils/python/lib/python2.7/site-packages/avocado_framework-68.0-py2.7.egg-info
> > > > > >> > Writing
> > > > > >>
> > > >
> > /mnt/us/testutils/python/lib/python2.7/site-packages/avocado_framework-68.0-py2.7.egg-info
> > > > > >> >
> > > > > >> >
> > > > > >> > And I still cannot see any subcommands when I directly executed
> > the
> > > > > >> avocado file:
> > > > > >> > [root at kindle us]# python avocado_s
> > > > > >> > ******
> > > > > >> > subcommands:
> > > > > >> >   valid subcommands
> > > > > >> >
> > > > > >> >   {}                    subcommand help
> > > > > >> >
> > > > > >> >
> > > > > >> > Do you have any idea?
> > > > > >> >
> > > > > >> > Thanks,
> > > > > >> > Junchao
> > > > > >> >
> > > > > >> >
> > > > > >> > On Mon, Feb 25, 2019 at 2:53 AM Lukáš Doktor <
> > ldoktor at redhat.com
> > > > > >> <mailto:ldoktor at redhat.com>> wrote:
> > > > > >> >
> > > > > >> >     Dne 22. 02. 19 v 18:09 Junchao Zhang napsal(a):
> > > > > >> >     > Dear avocado development team,
> > > > > >> >     >
> > > > > >> >     > My name is Kimi. Currently I am working on Linux
> > development.
> > > > Our
> > > > > >> team used Autotest before. Currently I am trying to use Avocado.
> > It is
> > > > > >> really a great framework. I have some questions that hope you can
> > > > help me
> > > > > >> with.
> > > > > >> >     >
> > > > > >> >     > 1. Since I do not want to do installation on our arm
> > system, I
> > > > > >> tried to manually run avocado.
> > > > > >> >     > I copied the avocado script ~/.local/bin/avocado and added
> > > > > >> necessary packages on the device. Then I can successfully running
> > > > "python
> > > > > >> SCRIPT_NAME". But looks like there is no subcommands options
> > > > available.
> > > > > >> >     > subcommands:
> > > > > >> >     >   valid subcommands
> > > > > >> >     >
> > > > > >> >     >   {}                    subcommand help
> > > > > >> >     >
> > > > > >> >     > Did I miss something so that I can do "python SCRIPT_NAME
> > > > run"?
> > > > > >> >     >
> > > > > >> >     > 2. When I tried avocado on my Ubuntu, it works fine. The
> > only
> > > > > >> issue is there isn't any tests available when I run "Avocado
> > list". I
> > > > just
> > > > > >> followed the instructions on online doc.
> > > > > >> >     >
> > > > > >> >     > Hope to hear back from you soon!
> > > > > >> >     >
> > > > > >> >     > Thanks,
> > > > > >> >     > Junchao
> > > > > >> >
> > > > > >> >     Dear Kimi,
> > > > > >> >
> > > > > >> >     Avocado uses stevedore as a plugin system which uses
> > setuptools
> > > > > >> entry points
> > > > > >>
> > > >
> > https://avocado-framework.readthedocs.io/en/latest/Plugins.html#registering-plugins
> > > > > >> to discover available plugins.
> > > > > >> >
> > > > > >> >     To setup Avocado for development you can simply clone the
> > git
> > > > repo
> > > > > >> to any location and use `python setup.py develop --user` (user
> > means
> > > > use
> > > > > >> "~/.local" and not "/usr") or simply by our `make develop` or
> > `make
> > > > link`
> > > > > >> makefile target (see `make help` for details), which creates
> > "links"
> > > > in
> > > > > >> "~/.local/lib". The difference in "install" vs. "develop" is that
> > it
> > > > won't
> > > > > >> copy the scripts, it simply tells python that this library is
> > located
> > > > in
> > > > > >> this directory, therefor any change in your cloned directory is
> > > > propagated
> > > > > >> (apart from new/renamed entry-points which requires to re-execute
> > > > "make
> > > > > >> develop").
> > > > > >> >
> > > > > >> >     Note the "develop" puts "avocado" binary to
> > > > "~/.local/bin/avocado".
> > > > > >> Using it usually requires extending the PATH, or executing
> > "python3
> > > > > >> scripts/avocado" from the cloned git location.
> > > > > >> >
> > > > > >> >     Last but not least, details on installing from git are here:
> > > > > >>
> > > >
> > https://avocado-framework.readthedocs.io/en/latest/GetStartedGuide.html#generic-installation-from-a-git-repository
> > > > > >> >
> > > > > >> >     Happy hacking,
> > > > > >> >     Lukáš
> > > > > >> >
> > > > > >> >     PS: Not sure what you require in your testing, there are two
> > > > debts
> > > > > >> we have compare to Autotest and that is multi-host testing
> > > > > >>
> > > >
> > https://trello.com/c/AnoH6vhP/530-rfc-multiple-machine-support-for-tests
> > > > > >> and tests surviving host reboot
> > > > > >>
> > > >
> > https://trello.com/c/mzhpqQyx/1233-add-avocado-service-to-allow-reboot-between-test-communication-and-even-safer-funcatexit
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
> 




More information about the Avocado-devel mailing list