Skip to content

Commit

Permalink
nixos/tests/installer: port to python
Browse files Browse the repository at this point in the history
  • Loading branch information
betaboon committed Nov 11, 2019
1 parent 556a169 commit 496db01
Show file tree
Hide file tree
Showing 2 changed files with 271 additions and 246 deletions.
8 changes: 8 additions & 0 deletions nixos/lib/test-driver/test-driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from xml.sax.saxutils import XMLGenerator
import _thread
import atexit
import base64
import json
import os
import ptpython.repl
Expand Down Expand Up @@ -710,6 +711,13 @@ def unblock(self):
"""
self.send_monitor_command("set_link virtio-net-pci.1 on")

def copy_file_from_host(self, from_path, to_path):
"""Copy a file to the machine.
"""
with open(from_path, "rb") as f:
content = base64.b64encode(f.read())
self.succeed("echo '{}' | base64 -d > {}".format(content.decode(), to_path))


def create_machine(args):
global log
Expand Down
Loading

0 comments on commit 496db01

Please sign in to comment.