Skip to content
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

qa/tasks/ceph.py: quote "<kind>" in command line #33775

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Mar 6, 2020

otherwise bash will intepret "kind" as a file when handling command like

sudo zgrep <kind> /var/log/ceph/valgrind/* /dev/null | sort | uniq

and try to feed its content to zgrep, and write the output of zgrep
to /var/log/ceph/valgrind/. this is not the intended behavior. what we
what to do is to pass "" as an argument to zgrep, along with
the globbed files names which matches "/var/log/ceph/valgrind/
".

in this change, "" is quoted as in the command line. it's also
what pipes.quote() does before the change of
35cf513.

this addresses the regression introduced by
35cf513.

Fixes: https://tracker.ceph.com/issues/44454
Signed-off-by: Kefu Chai kchai@redhat.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

otherwise bash will intepret "kind" as a file when handling command like
```
sudo zgrep <kind> /var/log/ceph/valgrind/* /dev/null | sort | uniq
```
and try to feed its content to zgrep, and write the output of zgrep
to /var/log/ceph/valgrind/*. this is not the intended behavior. what we
what to do is to pass "<kind>" as an argument to zgrep, along with
the globbed files names which matches "/var/log/ceph/valgrind/*".

in this change, "<kind>" is quoted as in the command line. it's also
what `pipes.quote()` does before the change of
35cf513.

this addresses the regression introduced by
35cf513.

Fixes: https://tracker.ceph.com/issues/44454
Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

tchaikov commented Mar 6, 2020

@tchaikov tchaikov added this to the octopus milestone Mar 6, 2020
@ajarr ajarr merged commit 6b45b3b into ceph:master Mar 6, 2020
@tchaikov tchaikov deleted the wip-44454 branch March 6, 2020 07:02
@ajarr
Copy link
Contributor

ajarr commented Mar 6, 2020

tests passed at http://pulpito.ceph.com/kchai-2020-03-06_04:28:08-rados:valgrind-leaks-master-distro-basic-smithi/

Works now.
Previously see,

2020-03-05T20:36:26.475 INFO:teuthology.orchestra.run.smithi006:> sudo zgrep <kind> /var/log/ceph/valgrind/* /dev/null | sort | uniq
2020-03-05T20:36:26.528 INFO:teuthology.orchestra.run.smithi006.stderr:bash: kind: No such file or directory

With this fix,

2020-03-06T04:53:50.413 INFO:teuthology.orchestra.run.smithi057:> sudo zgrep '<kind>' /var/log/ceph/valgrind/* /dev/null | sort | uniq
2020-03-06T04:53:50.507 INFO:teuthology.orchestra.run.smithi057.stdout:/var/log/ceph/valgrind/mon.a.log:  <kind>Leak_DefinitelyLost</kind>
2020-03-06T04:53:50.507 INFO:teuthology.orchestra.run.smithi057.stdout:/var/log/ceph/valgrind/mon.a.log:  <kind>UninitCondition</kind>
2020-03-06T04:53:50.507 INFO:teuthology.orchestra.run.smithi057.stdout:/var/log/ceph/valgrind/mon.b.log:  <kind>UninitCondition</kind>

@tchaikov
Copy link
Contributor Author

tchaikov commented Mar 6, 2020

@ajarr thanks for the review and verification!

@kshtsk
Copy link
Contributor

kshtsk commented Mar 6, 2020

that was cool

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

Successfully merging this pull request may close these issues.

3 participants