76 Commits

Author SHA1 Message Date
Joe Gordon
efe1957237 Fix and gate on E125
E125 continuation line does not distinguish itself from next logical
line.

E125 makes code more readable, and fixing all the existing issues allows
us to gate on this, making this one less thing reviewers have to check
for.

Fix was made using https://github.com/hhatto/autopep8

Change-Id: Ie569fd74fb84d220ceb87e37b1b1f39143bba80f
2013-07-04 08:49:45 +02:00
Stanislaw Pitucha
9f7eaca80d Remove trivial cases of unused variables (1)
Kill some of the variables marked as unused by flakes8. This should
allow to enable F841 check in the future.
Only trivial cases with no function calls and obviously pure functions
(like datetime.now(), or len()) are cleaned up here.

Part 1, split to reduce conflicts.

Change-Id: I82854349574ec4bcb9336aba626eefdaed81a8c8
2013-06-13 17:04:08 +00:00
Dirk Mueller
bf68a9592d Improve Python 3.x compatibility
Mechanical translation of the deprecated
except x,y: construct with except x as y:
The latter works with any Python >= 2.6.
Add Hacking check.

Change-Id: I845829d97d379c1cd9b3a77e7e5786586f263b64
2013-06-01 09:57:31 +02:00
Rick Harris
ca599a877f Record smoketest dependency on gFlags
The smoketests currently have a dependency on gFlags. Long term, this should
be converted to use openstack.common.cfg; but in the near term, we should
record this existing dependency.

Fixes bug 1174953

Change-Id: I465abc6a4a2e8f7ebd1fe70ad239c760960a82ed
2013-05-09 20:48:36 +00:00
Giampaolo Lauria
3a0d78e057 Removed print stmts in test cases
Fixes bug 1108978

Change-Id: I5113e67bad1aaafdbaa0adc202cac97ba8d0dfdb
2013-01-29 12:55:14 -05:00
Joe Gordon
4845fc2720 Fix hacking N302 import only modules
* Includes some general tools/hacking cleanup
* Fix several N302 cases
* Disable N302 until all cases are fixed

Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279
2013-01-24 09:52:58 -05:00
Sean Dague
5fca1d9e97 fix new N402 errors
fix the N402 errors that have slipped in in the last 48 hrs since
starting this patch series.

fix an N401 error that our scanner current can't find because it
only looks for doc strings on classes and defs.

this is the xeno's paradox of patch series, but we're getting close.

Change-Id: I4a763bb4c812335d853eae05c72464f18ab93297
2013-01-10 08:57:09 -05:00
Dan Prince
731c6b1d5d Fix wait_for_deleted function in SmokeTests.
Fixes the wait_for_not_running function in smoketests/base.py so
that it short circuits when an instance ID is deleted rather than
waits 60 seconds (the timeout). Previously this function had
two problems:

 1) It used Boto's instance.update() instead of instance.update(validate=True).
 Since update() returns returns quietly if no data about the instance was
 returned (aka the instance has been deleted) it effectively made this
 function almost always wait for the timeout (60 seconds). This makes the
 tests take about a minute longer than they need to unless #2 below
 occurs...

 2) It also introduced a race condition in that... if hit just right
 the instance.state would get set to 'terminated'. Which would cause
 the loop to short circuit. This might seem correct at first glance but
 in fact causes intermittent failures in some of the netadmin tests
 because security groups can't be deleted if a running (or exiting)
 instance is still assigned to them. In fact wait_for_not_running
 was added to guard against just this in the first place!

Also, renames the base.wait_for_not_running function to be
called wait_for_deleted (that is what we are really doing here)

Change-Id: I4486995a7d9028d876366e8d7a2c845520319b86
2012-11-21 10:57:25 -05:00
Dan Prince
6443cfeecb Update vol mount smoketest to wait for volume.
Updates the test_003_can_mount_volume smoke test so that it
waits for the volume to show up in /proc/partitions for up
to 60 seconds before proceeding. This eliminates the need for
a hard coded sleep value which can cause intermittent test failures.

Change-Id: Ibdc56a00e141211e40068c22fc268efeba6affff
2012-11-12 15:36:32 -05:00
Davanum Srinivas
f2cf3fc0cd Fix no attribute 'STD_OUT_HANDLE' on windows
rename STD_OUT_HANDLE to STD_OUTPUT_HANDLE

Fixes LP #1033528

Change-Id: I75830dc4d6017076647e040d4485f99ee68333ff
2012-11-02 14:42:25 -04:00
Dan Prince
ea3f31b7e9 Use paramiko.AutoAddPolicy for the smoketests.
Updates the Nova smoketests so that we use Paramiko's auto
add ssh key policy. This should help quiet down warnings like
this which we previously got when running the EC2 smoketests
with Nova:

/usr/lib/python2.7/site-packages/paramiko/client.py:95: UserWarning:
Unknown ssh-rsa host key for 172.20.0.3:
adb1c2f1fe461a35cd01283eac03d6fb

Fixes LP Bug #1064550.

Change-Id: I1611a3f6b54563b6a1d64c4f8e193a636ccb1c69
2012-10-09 13:29:31 -04:00
Joe Gordon
771458f724 Remove outdated moduleauthor tags
The moduelauthor tags are used by the docs to see who wrote what.
But many of them are outdated and wrong.

fixes bug 1044578

Change-Id: I9cc27430c906d1418faf28e1b53f6306c62e8f98
2012-10-01 15:25:47 -07:00
Dan Prince
c8416912d4 Update volume detach smoke test to check status.
Updates test_007_me_can_detach_volume so that it waits for
the volume status to become active for up to 10 seconds
after initiating the command to detach the volume.

Previously it just waited for 5 seconds without checking the
status which can be problematic in that it causes the
subsequent test to delete the volume to fail intermittently
(because only active or error volumes can be deleted).

I noticed this in SmokeStack because 2 days ago this commit landed:

b46f224f7555e3065b0daacd101b65d86117f0c1

and it is now causing a fair amount of intermittent volume
tests to fail for Nova and Cinder. Apparently now that we
have ordered the commands to remove an iscsi target properly
it takes a bit longer...

Change-Id: Ibfd25af93f9cb063a76a04138b8d23d28a01b89a
2012-09-21 12:15:59 -04:00
Monty Taylor
8d8d3b4296 Run hacking tests as part of the gate.
Nova has additional pep8 "plugins" that they expect to run as part of the
gate. This patch will run tools/hacking.py instead of pep8 directly. Also,
it fixes the hacking violaions in contrib, plugins and smoketests.

Fixes bug 1010136

Change-Id: I86d8789218c197d5d4a43d1201465d340646a395
2012-07-02 08:50:41 -04:00
Zhongyue Luo
61c5597a09 Backslash continuation removal (Nova folsom-2)
Fixes bug #938588

Backslash continuations removal for scripts in bin/, plugin/, and etc.

Change-Id: Idd17048b6e8db6e939946968e011e68da8585b8d
2012-05-31 11:26:37 +08:00
Matt Joyce
1bbf44fa67 Grammar / spelling corrections
Change-Id: Id5b6665a2a40a9bd0830c1a3500b4ad98eec435b
2012-05-29 12:04:36 -07:00
Russell Bryant
3dc539bcb0 Don't allow EC2 removal of security group in use.
Fix bug 817872.

This patch modifies the behavior of removing security groups via the EC2
API to better match the EC2 API spec. The EC2 documentation says that a
group that is still in use can not be removed.

A new function has been added to the db API to find out whether a
particular security group is still in use.  "In use" is defined as
applied to an active instance, or applied to another group that has not
been deleted.

Unit tests have been updated to ensure that an error is raised when
these conditions are hit.

Change-Id: I5b3fdf1da213b04084fe266c1a6ed92e01cf1e19
2012-02-14 17:20:53 -05:00
Hengqing Hu
c33bd50a79 Fix bad test cases in smoketest.
Fixes bug #912650.

Fixes the following test cases in
smoketests/test_netadmin.py:SecurityGroupTests:
    'test_004_can_access_metadata_over_public_ip'
    'test_005_validate_metadata'
    'test_999_tearDown'

Change-Id: Iefa8034a364e13243d06200e8af1840df896baf3
2012-01-10 10:39:35 +08:00
Vishvananda Ishaya
d06da5d652 Relax dependency on boto 1.9b and nova-adminclient
* change boto=1.9b to boto
 * fix the tests
 * remove nova-adminclient dependency
 * remove the useless smoketests for nova-adminclient

Change-Id: Ie191453941e64774496a912cb64d1417f3f1bea3
2011-12-08 11:19:47 -08:00
Jimmy Bergman
88acbe869a Fix for EC2 API part of bug 897164
Change-Id: I96344eaccd2f42b70223b3c155a4793ab00d09d5
2011-12-02 15:45:26 +01:00
Dan Prince
741d45ce20 Merge w/ trunk. 2011-08-16 08:41:52 -04:00
Vishvananda Ishaya
055c7692fc remove openwrt image 2011-08-15 11:31:44 -07:00
Dan Prince
c81febc28a Updated the EC2 metadata controller so that it returns the correct value
for instance-type metadata.
2011-08-09 16:00:54 -04:00
Dan Prince
458932a4f0 Update the curl command in the __public_instance_is_accessible function
of test_netadmin to return an error code which we can then check for
and handle properly. This should allow calling functions to properly
retry and timout if an actual test failure happens.
2011-08-06 22:59:09 -04:00
Dan Prince
336efaf814 Add exception logging for instance IDs in the __public_instance_is_accessible
smoke test function. This should help troubleshoot an intermittent failure.
2011-08-05 11:17:05 -04:00
Vishvananda Ishaya
0f5184da2b add smoketests to verify image listing 2011-07-20 17:46:32 +00:00
Devin Carlen
ce5ad4acbc Removed adminclient and referred to pypi nova_adminclient module 2011-03-30 20:33:56 -07:00
Vishvananda Ishaya
3a39fb7b09 add note per review 2011-03-28 16:50:33 -07:00
Vishvananda Ishaya
233fd09201 Fixes volume smoketests to work with ami-tty 2011-03-28 15:46:01 -07:00
Tushar Patil
8f7d6b9da8 Fix for LP Bug #739641 2011-03-21 12:21:24 -07:00
Soren Hansen
049e895bea Merge trunk 2011-03-20 20:04:51 +01:00
Soren Hansen
4b18488223 PEP-8 2011-03-18 13:17:40 +01:00
Soren Hansen
6e632e9ef2 Make flag parsing work again. 2011-03-18 13:14:37 +01:00
Soren Hansen
aa0d218e53 Merge lp:~anso/nova/smoketests_fixes 2011-03-18 12:35:00 +01:00
Soren Hansen
9eb64af0d7 Make proxy.sh work with both openbsd and traditional variants of netcat. 2011-03-18 11:27:38 +01:00
Soren Hansen
9608ef7d49 Query the size of the block device, not the size of the filesystem. 2011-03-18 11:06:58 +01:00
Tushar Patil
51ed0ccf8d Fix for LP Bug #737240 2011-03-17 18:54:51 -07:00
Tushar Patil
59d2a315b8 Fix for LP Bug #737240 2011-03-17 18:26:20 -07:00
Soren Hansen
83523c125a Invert some of the original logic and fix a typo. 2011-03-17 23:45:35 +01:00
Soren Hansen
57e3d5abb5 Make the smoketests pep8 compliant (they weren't when I started working on them..) 2011-03-17 23:37:34 +01:00
Soren Hansen
27d5cbaf03 Make smoketests' exit code reveal whether they were succesful. 2011-03-17 14:51:59 +01:00
Vishvananda Ishaya
5bb77cb83e add timeout and retry for ssh 2011-02-25 23:58:36 -08:00
Vishvananda Ishaya
bc7b96f11e revert a few unnecessary changes to base.py 2011-02-24 22:02:50 -08:00
Vishvananda Ishaya
24eb5c0b78 removed unused references to unittest 2011-02-24 21:33:26 -08:00
Vishvananda Ishaya
a6f607681f add customizable tempdir and remove extra code 2011-02-24 21:32:27 -08:00
Vishvananda Ishaya
498638ce36 make smoketests run with nose 2011-02-24 17:17:42 -08:00
Vishvananda Ishaya
fc465b2a9f fix check for existing port 22 rule 2011-02-24 00:25:21 -08:00
Vishvananda Ishaya
79d9e06d79 more smoketest fixes 2011-02-23 22:40:50 -08:00
Vishvananda Ishaya
d27aa094a1 remove extra flag in admin tests 2011-02-23 17:28:38 -08:00
Vishvananda Ishaya
ef37833e6f add netadmin smoketests 2011-02-22 18:04:32 -08:00