"make test" fails when invoked via an ssh session when the local user's locales are not available on the MAAS development machine

Bug #1420803 reported by Ricardo Bánffy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Ricardo Bánffy

Bug Description

When attempting to replicate the issues I was having on my development machine (running 14.10) on a clean environment, I set up a VM with 14.04.1 and ran the tests through ssh. One of the tests failed with:

======================================================================
FAIL: maascli.tests.test_integration.TestMAASCli.test_run_without_args_shows_help_reminder
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/work/maas/src/maascli/tests/test_integration.py", line 48, in test_run_without_args_shows_help_reminder
    e.output)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 327, in assertIn
    self.assertThat(haystack, Contains(needle))
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: u'Run /home/ubuntu/work/maas/bin/maas --help for usage details.' not in 'Traceback (most recent call last):\n File "/home/ubuntu/work/maas/bin/maas", line 14, in <module>\n maascli.main()\n File "/home/ubuntu/work/maas/src/maascli/__init__.py", line 29, in main\n locale.setlocale(locale.LC_ALL, "")\n File "/home/ubuntu/work/maas/lib/python2.7/locale.py", line 579, in setlocale\n return _setlocale(category, locale)\nlocale.Error: unsupported locale setting\n'

Running locale from the ssh session, I get:

ubuntu@maas:~/canonical/maas$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

but running it from the console, shows the expected output:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Running locale-gen for the missing locale or running the tests from the machine console solves the problem, but the dependence on locale data coming from the ssh session may have other implications.

This was done on a fresh server install, from a fresh "bzr branch lp:maas" checkout. No MAAS packages were installed except the ones provided with "make install-dependencies".

Related branches

summary: - make test fails when invoked via an ssh session when the local user's
+ "make test" fails when invoked via an ssh session when the local user's
locales are not available on the MAAS development machine
Changed in maas:
assignee: nobody → Ricardo Bánffy (rbanffy)
status: New → In Progress
importance: Undecided → Medium
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
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.