← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1825027] [NEW] cloudinit tests fail when running as root

 

Public bug reported:

The tests under cloudinit/cmd/tests/test_query.py will fail if run as
root.

sudo nosetests3 test_query.py --debug=query

query: WARNING: Missing root-readable /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data-sensitive.json. Using redacted /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data.json instead.
query: ERROR: Missing instance-data file: /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data.json
.Equery: ERROR: Missing instance-data file: /tmp/ci-TestQuery.2_qzzunv/absent
.query: ERROR: Expected one of the options: --all, --format, --list-keys or varname
.query: ERROR: No read permission on '/tmp/ci-TestQuery.faxmaofy/unreadable'. Try sudo
.EEEEEEquery: WARNING: Missing root-readable /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data-sensitive.json. Using redacted /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data.json instead.
query: ERROR: Missing instance-data file: /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data.json
..
======================================================================
ERROR: cloudinit.cmd.tests.test_query.TestQuery.test_handle_args_dumps_all_instance_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/anhvo/repos/cloud-init/cloudinit/cmd/tests/test_query.py", line 153, in test_handle_args_dumps_all_instance_data
    self.assertEqual(0, query.handle_args('anyname', args))
  File "/home/anhvo/repos/cloud-init/cloudinit/cmd/query.py", line 124, in handle_args
    instance_data['userdata'] = util.load_file(user_data_fn)
  File "/home/anhvo/repos/cloud-init/cloudinit/util.py", line 1359, in load_file
    with open(fname, 'rb') as ifh:
FileNotFoundError: [Errno 2] No such file or directory: 'ud'

======================================================================
ERROR: cloudinit.cmd.tests.test_query.TestQuery.test_handle_args_list_keys_errors_when_varname_is_not_a_dict
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/anhvo/repos/cloud-init/cloudinit/cmd/tests/test_query.py", line 255, in test_handle_args_list_keys_errors_when_varname_is_not_a_dict
    self.assertEqual(1, query.handle_args('anyname', args))
  File "/home/anhvo/repos/cloud-init/cloudinit/cmd/query.py", line 124, in handle_args
    instance_data['userdata'] = util.load_file(user_data_fn)
  File "/home/anhvo/repos/cloud-init/cloudinit/util.py", line 1359, in load_file
    with open(fname, 'rb') as ifh:
FileNotFoundError: [Errno 2] No such file or directory: 'ud'

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1825027

Title:
  cloudinit tests fail when running as root

Status in cloud-init:
  New

Bug description:
  The tests under cloudinit/cmd/tests/test_query.py will fail if run as
  root.

  sudo nosetests3 test_query.py --debug=query

  query: WARNING: Missing root-readable /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data-sensitive.json. Using redacted /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data.json instead.
  query: ERROR: Missing instance-data file: /tmp/ci-TestQuery.0ztjrur1/run_dir/instance-data.json
  .Equery: ERROR: Missing instance-data file: /tmp/ci-TestQuery.2_qzzunv/absent
  .query: ERROR: Expected one of the options: --all, --format, --list-keys or varname
  .query: ERROR: No read permission on '/tmp/ci-TestQuery.faxmaofy/unreadable'. Try sudo
  .EEEEEEquery: WARNING: Missing root-readable /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data-sensitive.json. Using redacted /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data.json instead.
  query: ERROR: Missing instance-data file: /tmp/ci-TestQuery.rhy7l_rq/run_dir/instance-data.json
  ..
  ======================================================================
  ERROR: cloudinit.cmd.tests.test_query.TestQuery.test_handle_args_dumps_all_instance_data
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/anhvo/repos/cloud-init/cloudinit/cmd/tests/test_query.py", line 153, in test_handle_args_dumps_all_instance_data
      self.assertEqual(0, query.handle_args('anyname', args))
    File "/home/anhvo/repos/cloud-init/cloudinit/cmd/query.py", line 124, in handle_args
      instance_data['userdata'] = util.load_file(user_data_fn)
    File "/home/anhvo/repos/cloud-init/cloudinit/util.py", line 1359, in load_file
      with open(fname, 'rb') as ifh:
  FileNotFoundError: [Errno 2] No such file or directory: 'ud'

  ======================================================================
  ERROR: cloudinit.cmd.tests.test_query.TestQuery.test_handle_args_list_keys_errors_when_varname_is_not_a_dict
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/anhvo/repos/cloud-init/cloudinit/cmd/tests/test_query.py", line 255, in test_handle_args_list_keys_errors_when_varname_is_not_a_dict
      self.assertEqual(1, query.handle_args('anyname', args))
    File "/home/anhvo/repos/cloud-init/cloudinit/cmd/query.py", line 124, in handle_args
      instance_data['userdata'] = util.load_file(user_data_fn)
    File "/home/anhvo/repos/cloud-init/cloudinit/util.py", line 1359, in load_file
      with open(fname, 'rb') as ifh:
  FileNotFoundError: [Errno 2] No such file or directory: 'ud'

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1825027/+subscriptions


Follow ups