Merge lp:~rvb/maas-test/fix-error-reporting into lp:maas-test

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: 95
Merged at revision: 95
Proposed branch: lp:~rvb/maas-test/fix-error-reporting
Merge into: lp:maas-test
Diff against target: 59 lines (+9/-11)
2 files modified
maastest/kvmfixture.py (+4/-3)
maastest/tests/test_kvmfixture.py (+5/-8)
To merge this branch: bzr merge lp:~rvb/maas-test/fix-error-reporting
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+198736@code.launchpad.net

Commit message

Use text_content instead of binary_content with addDetail.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (29.9 KiB)

The attempt to merge lp:~rvb/maas-test/fix-error-reporting into lp:maas-test failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com saucy-security InRelease
Ign http://nova.clouds.archive.ubuntu.com saucy InRelease
Get:1 http://security.ubuntu.com saucy-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com saucy-updates InRelease
Get:2 http://security.ubuntu.com saucy-security Release [49.6 kB]
Hit http://nova.clouds.archive.ubuntu.com saucy Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com saucy-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com saucy Release
Get:4 http://nova.clouds.archive.ubuntu.com saucy-updates Release [49.6 kB]
Hit http://nova.clouds.archive.ubuntu.com saucy/main Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en
Get:5 http://security.ubuntu.com saucy-security/main Sources [15.6 kB]
Get:6 http://security.ubuntu.com saucy-security/universe Sources [6,663 B]
Get:7 http://security.ubuntu.com saucy-security/main amd64 Packages [46.0 kB]
Get:8 http://security.ubuntu.com saucy-security/universe amd64 Packages [18.1 kB]
Hit http://security.ubuntu.com saucy-security/main Translation-en
Hit http://security.ubuntu.com saucy-security/universe Translation-en
Ign http://security.ubuntu.com saucy-security/main Translation-en_US
Get:9 http://nova.clouds.archive.ubuntu.com saucy-updates/main Sources [51.8 kB]
Get:10 http://nova.clouds.archive.ubuntu.com saucy-updates/universe Sources [19.1 kB]
Get:11 http://nova.clouds.archive.ubuntu.com saucy-updates/main amd64 Packages [151 kB]
Ign http://security.ubuntu.com saucy-security/universe Translation-en_US
Get:12 http://nova.clouds.archive.ubuntu.com saucy-updates/universe amd64 Packages [59.7 kB]
Get:13 http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en [67.8 kB]
Get:14 http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en [33.9 kB]
Ign http://nova.clouds.archive.ubuntu.com saucy/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en_US
Fetched 571 kB in 0s (2,439 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
cpu-checker is already the newest version.
python-distro-info is already the newest version.
python-fixtures is already the newest version.
python-lxml is already the newest version.
python-mock is already the newest version.
python-netaddr is already the newest version.
python-netifaces is already the newest version.
python-six is already the newest version.
python-testresources is already the newest version.
python-testtools is already the newest version.
python-xdg is already the newest version.
python3-fixtur...

95. By Raphaël Badin

Fix tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'maastest/kvmfixture.py'
--- maastest/kvmfixture.py 2013-12-10 14:09:16 +0000
+++ maastest/kvmfixture.py 2013-12-12 16:46:49 +0000
@@ -26,7 +26,6 @@
26from fixtures import Fixture26from fixtures import Fixture
27from lxml import etree27from lxml import etree
28from maastest.utils import (28from maastest.utils import (
29 binary_content,
30 extract_mac_ip_mapping,29 extract_mac_ip_mapping,
31 retries,30 retries,
32 run_command,31 run_command,
@@ -372,8 +371,10 @@
372 self.addDetail(cmd_prefix + ' retcode', text_content(str(retcode)))371 self.addDetail(cmd_prefix + ' retcode', text_content(str(retcode)))
373 input_detail = '' if input is None else input372 input_detail = '' if input is None else input
374 self.addDetail(cmd_prefix + ' input', text_content(input_detail))373 self.addDetail(cmd_prefix + ' input', text_content(input_detail))
375 self.addDetail(cmd_prefix + ' stdout', binary_content(stdout))374 u_stdout = unicode(stdout, errors='replace')
376 self.addDetail(cmd_prefix + ' stderr', binary_content(stderr))375 self.addDetail(cmd_prefix + ' stdout', text_content(u_stdout))
376 u_stderr = unicode(stderr, errors='replace')
377 self.addDetail(cmd_prefix + ' stderr', text_content(u_stderr))
377 return retcode, stdout, stderr378 return retcode, stdout, stderr
378379
379 def get_ip_from_network_scan(self, mac_address):380 def get_ip_from_network_scan(self, mac_address):
380381
=== modified file 'maastest/tests/test_kvmfixture.py'
--- maastest/tests/test_kvmfixture.py 2013-12-10 14:09:42 +0000
+++ maastest/tests/test_kvmfixture.py 2013-12-12 16:46:49 +0000
@@ -20,10 +20,7 @@
20import fixtures20import fixtures
21from lxml import etree21from lxml import etree
22from maastest import kvmfixture22from maastest import kvmfixture
23from maastest.utils import (23from maastest.utils import read_file
24 binary_content,
25 read_file,
26 )
27import mock24import mock
28import netaddr25import netaddr
29from six import text_type26from six import text_type
@@ -590,14 +587,14 @@
590 (587 (
591 text_type(return_value),588 text_type(return_value),
592 input,589 input,
593 binary_content(stdout_content),590 stdout_content,
594 binary_content(stderr_content),591 stderr_content,
595 ),592 ),
596 (593 (
597 details['cmd #0001 retcode'].as_text(),594 details['cmd #0001 retcode'].as_text(),
598 details['cmd #0001 input'].as_text(),595 details['cmd #0001 input'].as_text(),
599 details['cmd #0001 stdout'],596 details['cmd #0001 stdout'].as_text(),
600 details['cmd #0001 stderr'],597 details['cmd #0001 stderr'].as_text(),
601 ))598 ))
602599
603 def test_get_ip_from_network_scan(self):600 def test_get_ip_from_network_scan(self):

Subscribers

People subscribed via source and target branches