nixos/test: Fix escaping for copyFileFromHost

A long-time issue and one of the reasons I've never used that function
before. So let's remove that todo-comment and escape the contents
properly.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
This commit is contained in:
aszlig 2017-02-17 18:18:16 +01:00
parent 5231d0ac29
commit a5e9668c5c
No known key found for this signature in database
GPG key ID: 1DE8E48E57DB5436

View file

@ -607,7 +607,8 @@ sub waitForWindow {
sub copyFileFromHost {
my ($self, $from, $to) = @_;
my $s = `cat $from` or die;
$self->mustSucceed("echo '$s' > $to"); # !!! escaping
$s =~ s/'/'\\''/g;
$self->mustSucceed("echo '$s' > $to");
}