test_smartos fails in a chroot

Bug #1316597 reported by Juerg Haefliger
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Undecided
Unassigned
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

All tests from test_smartos.py fail in a chroot as follows (only first failure shown):

$ nosetests tests/unittests/test_datasource/test_smartos.py
FFFFFFFFFFFFFFFFFFFFF
======================================================================
FAIL: test_b64_keys (tests.unittests.test_datasource.test_smartos.TestSmartOSDataSource)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mocker.py", line 146, in test_method_wrapper
    result = test_method()
  File "/root/cloud-init/tests/unittests/test_datasource/test_smartos.py", line 270, in test_b64_keys
    self.assertTrue(ret)
AssertionError: False is not true
-------------------- >> begin captured logging << --------------------
cloudinit.importer: DEBUG: Looking for modules ['cloudinit.mergers.m_list'] that have attributes ['Merger']
cloudinit.importer: DEBUG: Found m_list with attributes ['Merger'] in ['cloudinit.mergers.m_list']
cloudinit.importer: DEBUG: Looking for modules ['cloudinit.mergers.m_dict'] that have attributes ['Merger']
cloudinit.importer: DEBUG: Found m_dict with attributes ['Merger'] in ['cloudinit.mergers.m_dict']
cloudinit.importer: DEBUG: Looking for modules ['cloudinit.mergers.m_str'] that have attributes ['Merger']
cloudinit.importer: DEBUG: Found m_str with attributes ['Merger'] in ['cloudinit.mergers.m_str']
cloudinit.mergers: DEBUG: Merging 'dict' into 'dict' using method '_handle_unknown' of 'LookupMerger: (3)'
cloudinit.mergers: DEBUG: Merging using located merger 'DictMerger: (method=no_replace,recurse_str=False,recurse_dict=True,recurse_array=False,allow_delete=False)' since it had method '_on_dict'
cloudinit.sources.DataSourceSmartOS: DEBUG: Host does not appear to be on SmartOS
--------------------- >> end captured logging << ---------------------

This is because DataSourceSmartOS.get_data() bails out if it can't find the seed (/dev/ttyS1), which obviously doesn't exist in a pbuilder chroot. The check for /dev/ttyS1 needs to be subbed out.

Related branches

Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott Moser (smoser) wrote :

fixed in revno 976

Changed in cloud-init (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Charles Plessy (plessy) wrote :

Thanks Scott ! This is very timely as Debian's cloud-init package just got http://bugs.debian.org/750314 filed because the package could not be rebuilt in a chroot.

Do you by chance plan an upstream release of cloud-init in the near future ? If not, I will apply revision 976 as a patch to the Debian package.

Have a nice day,

--
Charles

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.6~bzr976-0ubuntu1

---------------
cloud-init (0.7.6~bzr976-0ubuntu1) utopic; urgency=medium

  * debian/cloud-init.templates: fix choices so dpkg-reconfigure works as
    expected (LP: #1325746)
  * New upstream snapshot.
    * tests: SmartOS test not depend on /dev/ttyS1 device node (LP: #1316597)
    * poll ttyS1 only after check for 'cloudsigma' in dmidecode (LP: #1316475)
    * cloudsigma: support vendor-data (LP: #1303986)
 -- Scott Moser <email address hidden> Tue, 03 Jun 2014 16:41:07 -0400

Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

Charles, we'll get a new 0.7.6 sometime in the next few months at the latest.
i'd recommend picking the fix. sorry.

Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.7.6

Changed in cloud-init:
status: New → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.