opennebula: fail to sbuild, bash environment var failure EPOCHREALTIME

Bug #1813383 reported by Chad Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Undecided
Chad Smith

Bug Description

unittests are failing during packaging of cloud-init on disco during an sbuild due to failures in OpenNebula datasource unit tests.

Unit tests are now seeing EPOCHREALTIME values returned because those env values have changed across the unit test run.

OpenNebula datasource tries to exclude known bash -e env values that are known to change. and EPOCHREALTIME is one of the expected env variables that should continue to have a value delta.

======================================================================
FAIL: tests.unittests.test_datasource.test_opennebula.TestOpenNebulaDataSource.test_context_parser
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/unittests/test_datasource/test_opennebula.py", line 161, in test_context_parser
    self.assertEqual(TEST_VARS, results['metadata'])
AssertionError: {'VAR1': 'single', 'VAR2': 'double word', '[207 chars] '$'} != {'EPOCHREALTIME': '1548476675.477863', 'VAR[245 chars]e\n'}
+ {'EPOCHREALTIME': '1548476675.477863',
- {'VAR1': 'single',
? ^

+ 'VAR1': 'single',
? ^

   'VAR10': '\\',
   'VAR11': "'",
   'VAR12': '$',
   'VAR2': 'double word',
   'VAR3': 'multi\nline\n',
   'VAR4': "'single'",
   'VAR5': "'double word'",
   'VAR6': "'multi\nline\n'",
   'VAR7': 'single\\t',
   'VAR8': 'double\\tword',
   'VAR9': 'multi\\t\nline\n'}
-------------------- >> begin captured logging << --------------------
cloudinit.util: DEBUG: Reading from /tmp/ci-TestOpenNebulaDataSource.ms6gmudd/seed/opennebula/context.sh (quiet=False)
cloudinit.util: DEBUG: Read 262 bytes from /tmp/ci-TestOpenNebulaDataSource.ms6gmudd/seed/opennebula/context.sh
cloudinit.util: DEBUG: Running command ['bash', '-e'] with allowed return codes [0] (shell=False, capture=True)
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: tests.unittests.test_datasource.test_opennebula.TestOpenNebulaDataSource.test_seed_dir_empty1_context
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/unittests/test_datasource/test_opennebula.py", line 140, in test_seed_dir_empty1_context
    self.assertEqual(results['metadata'], {})
AssertionError: {'EPOCHREALTIME': '1548476675.848343'} != {}
- {'EPOCHREALTIME': '1548476675.848343'}
+ {}
-------------------- >> begin captured logging << --------------------
cloudinit.util: DEBUG: Reading from /tmp/ci-TestOpenNebulaDataSource.gu1w3vu_/seed/opennebula/context.sh (quiet=False)
cloudinit.util: DEBUG: Read 0 bytes from /tmp/ci-TestOpenNebulaDataSource.gu1w3vu_/seed/opennebula/context.sh
cloudinit.util: DEBUG: Running command ['bash', '-e'] with allowed return codes [0] (shell=False, capture=True)
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: tests.unittests.test_datasource.test_opennebula.TestOpenNebulaDataSource.test_seed_dir_empty2_context
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/unittests/test_datasource/test_opennebula.py", line 147, in test_seed_dir_empty2_context
    self.assertEqual(results['metadata'], {})
AssertionError: {'EPOCHREALTIME': '1548476675.863058'} != {}
- {'EPOCHREALTIME': '1548476675.863058'}
+ {}
-------------------- >> begin captured logging << --------------------
cloudinit.util: DEBUG: Reading from /tmp/ci-TestOpenNebulaDataSource.b3f_3ztm/seed/opennebula/context.sh (quiet=False)
cloudinit.util: DEBUG: Read 44 bytes from /tmp/ci-TestOpenNebulaDataSource.b3f_3ztm/seed/opennebula/context.sh
cloudinit.util: DEBUG: Running command ['bash', '-e'] with allowed return codes [0] (shell=False, capture=True)
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_no_seconds (tests.unittests.test_datasource.test_opennebula.TestParseShellConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tests/unittests/test_datasource/test_opennebula.py", line 921, in test_no_seconds
    self.assertEqual(ret, {"foo": "bar", "xx": "foo"})
AssertionError: {'foo': 'bar', 'xx': 'foo', 'EPOCHREALTIME': '1548476676.329965'} != {'foo': 'bar', 'xx': 'foo'}
- {'EPOCHREALTIME': '1548476676.329965', 'foo': 'bar', 'xx': 'foo'}
+ {'foo': 'bar', 'xx': 'foo'}
-------------------- >> begin captured logging << --------------------
cloudinit.util: DEBUG: Running command ['bash', '-e'] with allowed return codes [0] (shell=False, capture=True)
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1897 tests in 20.582s

FAILED (SKIP=10, failures=4)
make[2]: *** [Makefile:54: unittest3] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules:11: override_dh_auto_test] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:7: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2019-01-26T04:24:51Z

Finished
--------

+------------------------------------------------------------------------------+
| Cleanup |
+------------------------------------------------------------------------------+

Not cleaning session: cloned chroot in use
Keeping session: disco-amd64-9e2df49d-994c-41d4-85bf-b294a78a643c
E: Build failure (dpkg-buildpackage died)

Related branches

Chad Smith (chad.smith)
Changed in cloud-init:
assignee: nobody → Chad Smith (chad.smith)
status: New → In Progress
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit d1a2fe73 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=d1a2fe73

Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Chad Smith (chad.smith) wrote : Fixed in cloud-init version 19.1.

This bug is believed to be fixed in cloud-init in version 19.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → 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.

Other bug subscribers

Remote bug watches

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