qa/standalone: do not use /etc/fstab as an always-there bytes source#61812
qa/standalone: do not use /etc/fstab as an always-there bytes source#61812
Conversation
42e1ade to
2a3517c
Compare
idryomov
left a comment
There was a problem hiding this comment.
Not sure why I got CCed, but since I did ;)
| local dummyfile=$(file_with_random_data) | ||
| # something that is always there | ||
| local dummyfile='/etc/fstab' | ||
| local dummyfile2='/etc/resolv.conf' |
There was a problem hiding this comment.
I'm wondering why /etc/resolv.conf isn't subjected to the same file_with_random_data treatment. Can /etc/resolv.conf be assumed to always be there, unlike /etc/fstab?
There was a problem hiding this comment.
I too was debating whether to change that. But I did not have the pretext to do that: I do not have any reason to believe that resolve.conf may be missing.
But as you have noticed that too - I think I will re-push with this change, too.
|
TIL some tests were using fstab as 'random' data source... Fascinating ;-) |
2a3517c to
4fc5779
Compare
qa/standalone/ceph-helpers.sh
Outdated
| local size_bytes=${1:-512} | ||
| local file=$(mktemp) | ||
| dd if=/dev/urandom of=$file bs=$size_bytes count=1 | ||
| echo "$file" |
There was a problem hiding this comment.
| echo "$file" | |
| printf '%s' "$file" |
There was a problem hiding this comment.
Will change. Thanks
| # a second object (using a different size, for good measure) | ||
| local dummyfile2=$(file_with_random_data 1000) | ||
| rados -p $poolname put $objname $dummyfile2 || return 1 | ||
| rm -f $dummyfile2 |
There was a problem hiding this comment.
since this test is not evaluating the handling of an actual input file, you can do this more cleanly:
dd if=/dev/urandom bs=1000 count=1 | rados -p "$poolname" put "$objname" -
There was a problem hiding this comment.
(and elsewhere)
(( this is a nit ))
There was a problem hiding this comment.
Will change in all tests where dummyfile2 is used exactly once (as otherwise I'll have to verify that the test is not based on the assumption that the data is the same)
1288e0c to
1047eff
Compare
|
jenkins test make check arm64 |
f9d3290 to
e7e200b
Compare
|
jenkins test api |
e7e200b to
13749b5
Compare
Multiple tests use /etc/fstab when a small data file is
required as input. After all, as some comments say:
# something that is always there
Alas - it's not always there. Not in containers.
Replacing with a newly-created temporary file filled with
random bytes.
For completeness - replacing similar references to
/etc/resolv.conf (as a source for random objects) in
the standalone tests, too.
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
13749b5 to
8009a3d
Compare
|
jenkins test make check arm64 |
qa/standalone: do not use /etc/fstab as an always-there bytes source Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Multiple tests use /etc/fstab whenever a small data file is required as input. After all, as some comments say:
# something that is always there
Alas - it's not always there. Not in containers.
Replacing with a newly-created temporary file filled with random bytes.