Bug#756321: python-boto: run 'test.py unit' with proper 'python'

2016-05-23 Thread Scott Moser
On Sun, 22 May 2016, Eric Evans wrote:

> [ Scott Moser ]
> > When merging Ubuntu's python-boto delta from Debian, we have 2 changes
> > that we're carrying, both represented in the attached diff.
> >
> > a.) run tests/test.py with each python in 'pyversions -i'
> >This seemed simply typo/oversite.  debian/tests/unit was doing:
> >  for python in $(pyversions -i)
> >tests/test.py unit > /dev/null; done
> >It didn't seem like there was any way that the expected python
> >would be used there.  Instead, I changed it to run:
> >$python tests/test.py unit
>
> Definitely an oversight, thanks for bringing to my attention!

Thanks.

Looks like we can drop our delta if you get these two changes in, which is
great.

> > b.) Corey Bryant made a change to debian/tests/test.py described as
> > "d/tests/unit: Fix autopkgtest error in test_timeout." .
> > Unfortunately I don't have more information on this.

I forwarded this upstream to boto at
https://github.com/boto/boto/issues/3545

If you try running:
  nosetests -v tests/unit/manage/test_ssh.py

And you have python-paramiko installed (so it doesn't skip it).
Then its easily enough reproducible.  Basically the test (via paramiko)
requires a ~/.ssh/known_hosts.

You can rm -Rf ~/.ssh/ to test, or if you're adverse to that (which makes
sense) then something like below will still show it.

Let me know if you need anything else.

$ HOME=$(mktemp -d) nosetests -v tests/unit/manage/test_ssh.py
test_timeout (tests.unit.manage.test_ssh.TestSSHTimeout) ... ERROR

==
ERROR: test_timeout (tests.unit.manage.test_ssh.TestSSHTimeout)
--
Traceback (most recent call last):
  File "/home/ubuntu/python-boto-2.38.0/tests/unit/manage/test_ssh.py",
line 48, in test_timeout
test = SSHClient(server)
  File "/home/ubuntu/python-boto-2.38.0/boto/manage/cmdshell.py", line 62,
in __init__
self._ssh_client.load_host_keys(os.path.expanduser(host_key_file))
  File "/usr/lib/python2.7/dist-packages/paramiko/client.py", line 124, in
load_host_keys
self._host_keys.load(filename)
  File "/usr/lib/python2.7/dist-packages/paramiko/hostkeys.py", line 95,
in load
with open(filename, 'r') as f:
IOError: [Errno 2] No such file or directory:
'/tmp/tmp.HXnpo7af51/.ssh/known_hosts'

--
Ran 1 test in 0.001s



Bug#756321: python-boto: run 'test.py unit' with proper 'python'

2016-05-22 Thread Eric Evans
[ Scott Moser ] 
> When merging Ubuntu's python-boto delta from Debian, we have 2 changes
> that we're carrying, both represented in the attached diff.
> 
> a.) run tests/test.py with each python in 'pyversions -i'
>This seemed simply typo/oversite.  debian/tests/unit was doing:
>  for python in $(pyversions -i)
>tests/test.py unit > /dev/null; done
>It didn't seem like there was any way that the expected python
>would be used there.  Instead, I changed it to run:
>$python tests/test.py unit

Definitely an oversight, thanks for bringing to my attention!

> b.) Corey Bryant made a change to debian/tests/test.py described as
> "d/tests/unit: Fix autopkgtest error in test_timeout." .
> Unfortunately I don't have more information on this.

Interesting; I'm not seeing any errors, and I'd hate to add something like
this without understanding what problem it is meant to solve.

What's the best way for me to get more information on this?

> === modified file 'debian/tests/unit'
> --- debian/tests/unit 2014-03-30 12:36:49 +
> +++ debian/tests/unit 2014-07-28 19:20:40 +
> @@ -1,9 +1,23 @@
>  #/bin/sh
>  
> +set -ex
> +
> +#Create temporary home directory with .ssh/known_hosts file
> +#so that test_timeout will be able to work.
> +home_orig=$HOME
> +home_temp=$(mktemp -d)
> +mkdir -p "$home_temp/.ssh"
> +touch "$home_temp/.ssh/known_hosts"
> +export HOME=$home_temp
> +
>  set -eu
>  cp -r tests "$ADTTMP/"
>  cd "$ADTTMP"
>  
>  for python in $(pyversions -i); do
> -tests/test.py unit > /dev/null
> +$python tests/test.py unit > /dev/null
>  done
> +
> +#Restore original home directory and remove temp home dir
> +export HOME=$home_orig
> +rm -rf $home_temp
> 


-- 
Eric Evans
eev...@sym-link.com


signature.asc
Description: PGP signature


Bug#756321: python-boto: run 'test.py unit' with proper 'python'

2014-07-28 Thread Scott Moser
Package: python-boto
Version: 2.29.1-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu utopic ubuntu-patch

Dear Maintainer,

When merging Ubuntu's python-boto delta from Debian, we have 2 changes
that we're carrying, both represented in the attached diff.

a.) run tests/test.py with each python in 'pyversions -i'
   This seemed simply typo/oversite.  debian/tests/unit was doing:
 for python in $(pyversions -i)
   tests/test.py unit  /dev/null; done
   It didn't seem like there was any way that the expected python
   would be used there.  Instead, I changed it to run:
   $python tests/test.py unit

b.) Corey Bryant made a change to debian/tests/test.py described as
d/tests/unit: Fix autopkgtest error in test_timeout. .
Unfortunately I don't have more information on this.

Scott

In Ubuntu, the attached patch was applied to achieve the following:

  * Merge with debian. Remaining Ubuntu changes:
* d/tests/unit: Fix autopkgtest error in test_timeout.
* d/tests/unit: run tests/test.py with each python in 'pyversions -i'


Thanks for considering the patch.


-- System Information:
Debian Release: jessie/sid
  APT prefers utopic-updates
  APT policy: (500, 'utopic-updates'), (500, 'utopic-security'), (500, 
'utopic'), (100, 'utopic-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-5-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/tests/unit'
--- debian/tests/unit	2014-03-30 12:36:49 +
+++ debian/tests/unit	2014-07-28 19:20:40 +
@@ -1,9 +1,23 @@
 #/bin/sh
 
+set -ex
+
+#Create temporary home directory with .ssh/known_hosts file
+#so that test_timeout will be able to work.
+home_orig=$HOME
+home_temp=$(mktemp -d)
+mkdir -p $home_temp/.ssh
+touch $home_temp/.ssh/known_hosts
+export HOME=$home_temp
+
 set -eu
 cp -r tests $ADTTMP/
 cd $ADTTMP
 
 for python in $(pyversions -i); do
-tests/test.py unit  /dev/null
+$python tests/test.py unit  /dev/null
 done
+
+#Restore original home directory and remove temp home dir
+export HOME=$home_orig
+rm -rf $home_temp