[CI]: Added option to start vm undemonized
@@ -89,11 +89,11 @@ class MicrovmBuilder:
fc_binary=None,
jailer_binary=None,
use_ramdisk=False,
- smt=None):
+ smt=None, daemonize=True):
"""Build a fresh microvm."""
vm = init_microvm(self.root_path, self.bin_cloner_path,
fc_binary, jailer_binary)
-
+ vm.jailer.daemonize = daemonize
# Start firecracker.
vm.spawn(use_ramdisk=use_ramdisk)
@@ -173,10 +173,12 @@ class MicrovmBuilder:
# Enable incremental snapshot capability.
diff_snapshots=False,
use_ramdisk=False,
- fc_binary=None, jailer_binary=None):
+ fc_binary=None, jailer_binary=None,
+ daemonize=True):
"""Build a microvm from a snapshot artifact."""
vm = init_microvm(self.root_path, self.bin_cloner_path,
fc_binary, jailer_binary,)
+ vm.jailer.daemonize = daemonize
vm.spawn(log_level='Error', use_ramdisk=use_ramdisk)
vm.api_session.untime()
@@ -227,7 +229,8 @@ class MicrovmBuilder:
def build_from_artifacts(self, config,
kernel, disks, cpu_template,
net_ifaces=None, diff_snapshots=False,
- fc_binary=None, jailer_binary=None):
+ fc_binary=None, jailer_binary=None,
+ daemonize=True):
"""Spawns a new Firecracker and applies specified config."""
artifacts = ArtifactCollection(_test_images_s3_bucket())
# Pick the first artifact in the set.
@@ -253,10 +256,11 @@ class MicrovmBuilder:
diff_snapshots=diff_snapshots,
cpu_template=cpu_template,
fc_binary=fc_binary,
- jailer_binary=jailer_binary)
+ jailer_binary=jailer_binary,
+ daemonize=daemonize)
def build_vm_nano(self, fc_binary=None, jailer_binary=None,
- net_ifaces=None, diff_snapshots=False):
+ net_ifaces=None, diff_snapshots=False, daemonize=True):
"""Create a clean VM in an initial state."""
return self.build_from_artifacts("2vcpu_256mb",
"vmlinux-4.14",
@@ -265,7 +269,8 @@ class MicrovmBuilder:
net_ifaces=net_ifaces,
diff_snapshots=diff_snapshots,
fc_binary=fc_binary,
- jailer_binary=jailer_binary)
+ jailer_binary=jailer_binary,
+ daemonize=daemonize)
def build_vm_micro(self, fc_binary=None, jailer_binary=None,
net_ifaces=None, diff_snapshots=False):
