Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Test test_all_files_in_kibana_directory_are_group_writable fails with latest snapshot #99

Closed
mgreau opened this issue Sep 12, 2018 · 4 comments

Comments

@mgreau
Copy link
Member

mgreau commented Sep 12, 2018

The test test_all_files_in_kibana_directory_are_group_writable fails since today on the CI with the latest snapshot image built on Sep 12, 2018

I reproduce this problem locally:

vagrant@mgreau-node01:~/kibana-docker$ make from-snapshot test-snapshot
rm -rf snapshots
mkdir -p snapshots/kibana/target
(cd snapshots/kibana/target && \
  wget https://snapshots.elastic.co/downloads/kibana/kibana-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz && \
  wget https://snapshots.elastic.co/downloads/kibana/kibana-oss-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz)
--2018-09-12 11:55:38--  https://snapshots.elastic.co/downloads/kibana/kibana-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz
Resolving snapshots.elastic.co (snapshots.elastic.co)... 54.235.82.130, 54.235.171.120, 107.21.239.197, ...
Connecting to snapshots.elastic.co (snapshots.elastic.co)|54.235.82.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 184357810 (176M) [application/x-gzip]
Saving to: ‘kibana-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz’

kibana-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz  100%[=============================================================================================================>] 175.82M  29.6MB/s    in 6.5s

2018-09-12 11:55:45 (27.0 MB/s) - ‘kibana-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz’ saved [184357810/184357810]

--2018-09-12 11:55:45--  https://snapshots.elastic.co/downloads/kibana/kibana-oss-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz
Resolving snapshots.elastic.co (snapshots.elastic.co)... 184.73.245.233, 54.225.214.74, 107.21.127.184, ...
Connecting to snapshots.elastic.co (snapshots.elastic.co)|184.73.245.233|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 73107737 (70M) [application/x-gzip]
Saving to: ‘kibana-oss-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz’

kibana-oss-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar 100%[=============================================================================================================>]  69.72M  23.7MB/s    in 2.9s

2018-09-12 11:55:49 (23.7 MB/s) - ‘kibana-oss-7.0.0-alpha1-SNAPSHOT-linux-x86_64.tar.gz’ saved [73107737/73107737]
...

Result

tests/test_files.py::test_all_files_in_kibana_directory_are_group_writable[docker://kibana-test] FAILED

=============================================================================================== FAILURES ===============================================================================================
_____________________________________________________________ test_all_files_in_kibana_directory_are_group_writable[docker://kibana-test] ______________________________________________________________

kibana = <tests.fixtures.kibana.<locals>.Kibana object at 0x7effcdc5bf98>

    def test_all_files_in_kibana_directory_are_group_writable(kibana):
        bad_files = kibana.stdout_of('find /usr/share/kibana ! -perm /g+w').split()
>       assert len(exclude_browser_files(bad_files)) is 0
E       AssertionError: assert 1 is 0
E        +  where 1 = len(['/usr/share/kibana/data/headless_shell-linux/headless_shell'])
E        +    where ['/usr/share/kibana/data/headless_shell-linux/headless_shell'] = exclude_browser_files(['/usr/share/kibana/data/headless_shell-linux/headless_shell'])

tests/test_files.py:45: AssertionError
=========================================================================================== warnings summary ===========================================================================================
/home/vagrant/kibana-docker/venv/lib/python3.5/site-packages/testinfra/modules/process.py:113: DeprecationWarning: get_module() is deprecated, use new host API
  if (host.system_info.type == "linux"
/home/vagrant/kibana-docker/venv/lib/python3.5/site-packages/testinfra/modules/base.py:26: DeprecationWarning: get_module() is deprecated, use new host API
  "run_expect": _host.run_expect,
/home/vagrant/kibana-docker/venv/lib/python3.5/site-packages/testinfra/modules/base.py:27: DeprecationWarning: get_module() is deprecated, use new host API
  "run_test": _host.run_test,
/home/vagrant/kibana-docker/venv/lib/python3.5/site-packages/testinfra/modules/base.py:28: DeprecationWarning: get_module() is deprecated, use new host API
  "check_output": _host.check_output,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================================================================== 1 failed, 16 passed, 4 warnings in 13.30 seconds ===========================================================================

@mgreau
Copy link
Member Author

mgreau commented Sep 12, 2018

@jarpy
Copy link
Contributor

jarpy commented Sep 13, 2018

Lots of changes related to that path in elastic/kibana#21788

@tylersmalley
Copy link
Contributor

@chrisdavies is this related to your Chromium changes?

@jarpy
Copy link
Contributor

jarpy commented Sep 13, 2018

If it is, we may just need to update the tests. Note that we assert that nothing is returned by:

exclude_browser_files(bad_files)).

exclude_browser_files might just need tweaking.

def exclude_browser_files(files):
'''Return all files that are not part of a browser
Useful for permission tests, since browsers get installed at runtime and
can have unexpected ownership, group or mode.
'''
# REF: https://github.com/elastic/kibana/blob/fe4609647dd2a7a7fedfb23d63f5886a24eacbe1/x-pack/plugins/reporting/server/browsers/install.js#L41 # noqa
return [f for f in files if not f.startswith('/usr/share/kibana/data/phantomjs-')]

jarpy added a commit that referenced this issue Sep 17, 2018
Kibana installs headless browsers at runtime. We can't control the
permissions of these files at build time, so we should not make
assertions about those permissions.

This patch excludes new files that were added by elastic/kibana#21788.

Fixes #99
jarpy added a commit that referenced this issue Sep 17, 2018
Kibana installs headless browsers at runtime. We can't control the
permissions of these files at build time, so we should not make
assertions about those permissions.

This patch excludes new files that were added by elastic/kibana#21788.

Fixes #99
jarpy added a commit that referenced this issue Sep 17, 2018
Kibana installs headless browsers at run time. We can't control the
permissions of these files at build time, so we should not make
assertions about those permissions.

This patch excludes new files that were added by elastic/kibana#21788.

Fixes #99
jarpy added a commit that referenced this issue Sep 17, 2018
Kibana installs headless browsers at run time. We can't control the
permissions of these files at build time, so we should not make
assertions about those permissions.

This patch excludes new files that were added by elastic/kibana#21788.

Fixes #99
jarpy added a commit that referenced this issue Sep 17, 2018
Kibana installs headless browsers at run time. We can't control the
permissions of these files at build time, so we should not make
assertions about those permissions.

This patch excludes new files that were added by elastic/kibana#21788.

Fixes #99
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants