Sha256: 9a2a5da64e961a104d735f2f630e2d0c78b662eb0b38656d1e17b278dad123f8
Contents?: true
Size: 896 Bytes
Versions: 65
Compression:
Stored size: 896 Bytes
Contents
module SpecInfra module Backend class Lxc < Exec def run_command(cmd, opts={}) cmd = build_command(cmd) cmd = add_pre_command(cmd) out, ret = ct.execute do out = `#{cmd}` [out, $?.dup] end if @example @example.metadata[:command] = cmd @example.metadata[:stdout] = out end CommandResult.new :stdout => out, :exit_status => ret.exitstatus end def build_command(cmd) cmd end def add_pre_command(cmd) cmd end def copy_file(from, to) begin FileUtils.cp(from, File.join(ct.config_item('lxc.rootfs'), to)) rescue => e return false end true end def ct @ct ||= ::LXC::Container.new(RSpec.configuration.lxc) end end end end
Version data entries
65 entries across 65 versions & 1 rubygems