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
Add support for backing up disks during test #2341
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
This is an automatically generated QA checklist based on modified files. |
s/[backuping/backing up/ |
Codecov Report
@@ Coverage Diff @@
## master #2341 +/- ##
==========================================
+ Coverage 95.05% 95.07% +0.02%
==========================================
Files 155 155
Lines 15277 15340 +63
==========================================
+ Hits 14521 14584 +63
Misses 756 756
|
8b74252
to
18b8304
Compare
64b49b3
to
2916b8d
Compare
1201cd7
to
aabe020
Compare
aae6731
to
fd43775
Compare
backend/qemu.pm
Outdated
my $my_node = "$node-$fname"; | ||
my $bck_file = "assets_public/$my_node-$vars->{NAME}.qcow2"; | ||
# create disk | ||
runcmd('qemu-img', 'create', '-f', 'qcow2', "$bck_file", "$size"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runcmd('qemu-img', 'create', '-f', 'qcow2', "$bck_file", "$size"); | |
runcmd('qemu-img', 'create', '-f', 'qcow2', $bck_file, $size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, for $size
yes but ab $bck_file
are needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this variable need quotes?
41bc7e5
to
058d3ce
Compare
my $my_node = "$node-$fname"; | ||
my $bck_file = "assets_public/$my_node-$vars->{NAME}.qcow2"; | ||
# create disk | ||
runcmd('qemu-img', 'create', '-f', 'qcow2', "$bck_file", $size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does $bck_file
need quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath .. so can contain space and other awful characters...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it can. But the quotes around the variable don't make any difference.
We're using perl here, not bash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at what happens here:
% perl -wE'
sub runcmd {
my ($path) = @_;
say "path: >>$path<<";
}
my $arg = "some path with spaces";
runcmd($arg);
runcmd("$arg");'
path: >>some path with spaces<<
path: >>some path with spaces<<
So in the function runcmd
it will end up without quotes in any case.
If you wanted to add quotes, you would have to do qq{"$bck_file"}
. But that doesn't make sense. The runcmd
function will take care of it anyway. Those variables aren't passed to a shell. Otherwise we would already have a problem with existing runcmd
calls.
https://progress.opensuse.org/issues/130922
VR: http://quasar.suse.cz/tests/2962