New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker/testshell_markdown tests fail due to cascading #1773

Open
waht opened this Issue Jan 7, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@waht
Contributor

waht commented Jan 7, 2018

Steps to Reproduce the Problem

When building Elektra in a Docker container (doc/docker) with CMake defaults and running make run_all the following tests fail due to cascading:

testshell_markdown_readme_msr
testshell_markdown_issue_template
testshell_markdown_tutorial_cascading
testshell_markdown_csvstorage
testshell_markdown_conditionals
testshell_markdown_dini
testshell_markdown_directoryvalue
testshell_markdown_enum
testshell_markdown_line
testshell_markdown_mathcheck
testshell_markdown_yajl
testshell_markdown_tutorial_validation
testshell_markdown_ini: probably affected by other failed tests (e.g. already used mountpoints)
testshell_markdown_mini

In the container all tests are run as root. Therefore when cascading, keys are written to the system instead of the user namespace.

Tests without annotations in the list above fail due to cascading/namespace issues (like testshell_markdown_readme_msr):

        Start 107: testshell_markdown_readme_msr
107/162 Test #107: testshell_markdown_readme_msr ............***Failed    0.62 sec
kdb set /examples/markdown/napalm death

ERROR - STDOUT:
“Using name system/examples/markdown/napalm
Create a new key system/examples/markdown/napalm with string "death"”
does not match
“Using name user/examples/markdown/napalm⏎Create a new key user/examples/markdown/napalm with string "death"”

Possible Solutions

  1. Require tests not to be run as root.
  2. Rewrite tests without cascading (although some markdown examples will still require cascading).
  3. Use an indicator that relaxes kdb output validation for namespaces.

For example:

kdb set /examples/markdown/napalm death
#> Using name user*/examples/markdown/napalm
#> Create a new key user*/examples/markdown/napalm with string "death"

And add some message like "* The actual namespace used depends on the current user."

I assume rewriting most examples not to use cascading and relaxing output validation will fix most of the failed tests.

System Information

  • Elektra Version: master

Further Log Files and Output

run_all.log

@waht waht added the bug label Jan 7, 2018

@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Jan 7, 2018

Contributor

Thank you for reporting this problem!

Yes, its wrong to assume that keys are written to the namespace user when setting a cascading key. I like the idea of an indicator which is replaced by any namespace. Alternatively, we could use regex:

kdb set /examples/markdown/napalm death
#> Using name .*/examples/markdown/napalm
#> Create a new key .*/examples/markdown/napalm with string "death"

Btw. (not related to this issue) you might also be interested in the discussion happening in #1715 where @BernhardDenner argued that tests should not be executed as root.

Contributor

markus2330 commented Jan 7, 2018

Thank you for reporting this problem!

Yes, its wrong to assume that keys are written to the namespace user when setting a cascading key. I like the idea of an indicator which is replaced by any namespace. Alternatively, we could use regex:

kdb set /examples/markdown/napalm death
#> Using name .*/examples/markdown/napalm
#> Create a new key .*/examples/markdown/napalm with string "death"

Btw. (not related to this issue) you might also be interested in the discussion happening in #1715 where @BernhardDenner argued that tests should not be executed as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment