Merge ~smoser/cloud-init:fix/locale-test-update into cloud-init:master

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: 80bf98b9c7d5197592c8b3e4edb6b958f8b31453
Merged at revision: 80bf98b9c7d5197592c8b3e4edb6b958f8b31453
Proposed branch: ~smoser/cloud-init:fix/locale-test-update
Merge into: cloud-init:master
Diff against target: 24 lines (+5/-2)
1 file modified
tests/cloud_tests/testcases/modules/locale.py (+5/-2)
Reviewer Review Type Date Requested Status
Scott Moser Approve
Joshua Powers (community) Approve
Server Team CI bot continuous-integration Needs Fixing
Review via email: mp+328095@code.launchpad.net

Commit message

tests: adjust locale integration test to parse default locale.

The locale integration test started failing with commit 0ef61b28.
This was just because the test's expectations on the content/formatting
of /etc/default/locale were too strict. The change here is to read
the file as a set of shell variables and assert that the values are
set correctly.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:85d887eb0beabfadea407eff508614856aec53c3
https://jenkins.ubuntu.com/server/job/cloud-init-ci/94/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    FAILED: CentOS 6 & 7: Build & Test

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/94/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Joshua Powers (powersj) :
review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

I'm ignoring the failure above as that is now fixed on trunk.
8a5296c41db45be3a172862f324ad44e732a2250
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/328101

so, pulling this. thanks for review.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/testcases/modules/locale.py b/tests/cloud_tests/testcases/modules/locale.py
2index 63e53ff..cb9e1dc 100644
3--- a/tests/cloud_tests/testcases/modules/locale.py
4+++ b/tests/cloud_tests/testcases/modules/locale.py
5@@ -3,14 +3,17 @@
6 """cloud-init Integration Test Verify Script."""
7 from tests.cloud_tests.testcases import base
8
9+from cloudinit import util
10+
11
12 class TestLocale(base.CloudTestCase):
13 """Test locale is set properly."""
14
15 def test_locale(self):
16 """Test locale is set properly."""
17- out = self.get_data_file('locale_default')
18- self.assertIn('LANG="en_GB.UTF-8"', out)
19+ data = util.load_shell_content(self.get_data_file('locale_default'))
20+ self.assertIn("LANG", data)
21+ self.assertEqual('en_GB.UTF-8', data['LANG'])
22
23 def test_locale_a(self):
24 """Test locale -a has both options."""

Subscribers

People subscribed via source and target branches