[Avocado-devel] New EC2 plugin

Lukáš Doktor ldoktor at redhat.com
Wed Feb 3 13:30:52 UTC 2016


Dne 29.1.2016 v 21:00 Cleber Rosa napsal(a):
>
>
> ----- Original Message -----
>> From: "Lucas Meneghel Rodrigues" <lookkas at gmail.com>
>> To: "avocado-devel" <avocado-devel at redhat.com>
>> Sent: Thursday, January 28, 2016 7:28:04 PM
>> Subject: Re: [Avocado-devel] New EC2 plugin
>>
>> OK, today I talked to Cleber and we figured out what was wrong. Patches
>> will follow.
>
> For those interested in understanding what was wrong, and what still is wrong,
> here are a few pointers.
>
> 1) https://github.com/avocado-framework/avocado/pull/992
>
> This reverts a patch of mine (also a type of revert itself), that deal with
> how the (remote) test results are set. Basically, it rendered that action a
> noop, an no remote test result were effectively applied.
>
> 2) https://github.com/avocado-framework/avocado/pull/994
>
> A code explanation of how fragile is the method to set the remote test result
> we've been using.
>
> I hope this will generate a broader understanding of all the issues involved
> and that a comprehensive fix will follow.
>
>>
>> I did test the plugin and it's working well. This first PR was merged, and
>> I'll work on packaging.
>>
>> On Thu, Jan 28, 2016 at 1:17 AM Lucas Meneghel Rodrigues <lookkas at gmail.com>
>> wrote:
>>
>>> Hi guys:
>>>
>>> As part of my effort to try to flush all my internal patches that have
>>> been accumulating over the months, I've created a new, separate repo with
>>> my EC2 plugin, and ask whomever has time to review my code to check:
>>>
>>> https://github.com/avocado-framework/avocado-ec2/pull/1
>>>
>>> I tried to follow the new plugin practices as much as I could figure, and
>>> did some refactoring of the original code, that should be more robust in
>>> cleaning up resources from AWS.
>>>
>>> Now, I can't for the life of me figure out how plugins to the 'run'
>>> command are working these days.  I have installed my plugin with 'sudo
>>> python setup.py develop', then checked the command line options:
>>>
>>> test execution on an EC2 (Amazon Elastic Cloud) instance:
>>>    --ec2-ami-id EC2_AMI_ID
>>>                          Amazon Machine Image ID. Example: ami-e08adb8a
>>>    --ec2-ami-username EC2_AMI_USERNAME
>>>                          User for the AMI image login. Defaults to root
>>>    --ec2-ami-distro-type EC2_AMI_DISTRO_TYPE
>>>                          AMI base Linux Distribution. Valid values: fedora
>>> (for
>>>                          Fedora > 22), el (for RHEL/CentOS > 6.0), ubuntu
>>> (for
>>>                          Ubuntu > 14.04). Defaults to fedora
>>>    --ec2-instance-ssh-port EC2_INSTANCE_SSH_PORT
>>>                          sshd port for the EC2 instance. Defaults to 22
>>>    --ec2-security-group-ids EC2_SECURITY_GROUP_IDS
>>>                          Comma separated list of EC2 security group IDs.
>>>                          Example: sg-a5e1d7b0
>>>    --ec2-subnet-id EC2_SUBNET_ID
>>>                          EC2 subnet ID. Example: subnet-ec4a72c4
>>>    --ec2-instance-type EC2_INSTANCE_TYPE
>>>                          EC2 instance type. Example: c4.xlarge
>>>    --ec2-login-timeout SECONDS
>>>                          Amount of time (in seconds) to wait for a
>>> successful
>>>                          connection to the EC2 instance. Defaults to 120
>>>                          seconds
>>>
>>> Sweet. It seems to be working, right? Now let me try to run it:
>>>
>>> avocado run passtest --ec2-ami-id ami-05f4ed35 --ec2-ami-distro-type
>>> fedora --ec2-security-group-ids sg-81703ae4 --ec2-subnet-id subnet-5207ee37
>>> --ec2-instance-type t2.micro
>>> JOB ID     : 58d7e8867502a12601e60d16ff17bc23df657a01
>>> JOB LOG    :
>>> /home/lmr/avocado/job-results/job-2016-01-28T01.13-58d7e88/job.log
>>> TESTS      : 1
>>>   (1/1) passtest.py:PassTest.test: PASS (0.00 s)
>>> RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0
>>> JOB HTML   :
>>> /home/lmr/avocado/job-results/job-2016-01-28T01.13-58d7e88/html/results.html
>>> TIME       : 0.00 s
>>>
>>> Hmm, that ended too fast, so there's something up. Let's try a bogus
>>> command line for the remote plugin, then:
>>>
>>> avocado run passtest --vm-domain domain --vm-username user --vm-password
>>> pass
>>> JOB ID     : c0349ba261f2dd0c47469394a2e58d88be1742b7
>>> JOB LOG    :
>>> /home/lmr/avocado/job-results/job-2016-01-28T01.14-c0349ba/job.log
>>> TESTS      : 1
>>>   (1/1) passtest.py:PassTest.test: PASS (0.00 s)
>>> RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0
>>> JOB HTML   :
>>> /home/lmr/avocado/job-results/job-2016-01-28T01.14-c0349ba/html/results.html
>>> TIME       : 0.00 s
>>>
>>> Same result. What's going on? I even checked if I had an older version of
>>> avocado through apt-get (which I did, but then removed and re-ran the
>>> develop commands).
>>>
>>> So I'm at a loss, and without energy to figure out what's going on. I've
>>> been running a custom version of avocado on my test environments, pre
>>> plugin refactor, so I haven't had any problems until I sit to flush my
>>> patches.
>>>
>>> I appreciate any help you guys could provide.
>>>
>>> Thanks!
>>>
>>
>> _______________________________________________
>> Avocado-devel mailing list
>> Avocado-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>
>
> _______________________________________________
> Avocado-devel mailing list
> Avocado-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/avocado-devel
>

Yep, I had the "bad" version on the presentation... (luckily I knew when 
to switch to older version)

Btw Lucas, you can use "make link", which calls "python setup.py develop 
--user" for each repo (at least if you copied the Makefile)

Regards,
Lukáš




More information about the Avocado-devel mailing list