lib/testlab/container/support.rb in testlab-1.6.1 vs lib/testlab/container/support.rb in testlab-1.6.2
- old
+ new
@@ -13,9 +13,29 @@
when "fedora" then
%W(-f /etc/lxc/#{self.id} -t #{self.distro} -- --release #{self.release})
end
end
+ # Returns arguments for lxc-start
+ #
+ # @return [Array<String>] An array of arguments for lxc-start
+ def start_args
+ arguments = Array.new
+
+ unless self.aa_profile.nil?
+ arguments << %W(-s lxc.aa_profile="#{self.aa_profile}")
+ end
+
+ unless self.cap_drop.nil?
+ cap_drop = [self.cap_drop].flatten.compact.map(&:downcase).join(' ')
+ arguments << %W(-s lxc.cap.drop="#{cap_drop}")
+ end
+
+ arguments << %W(-d)
+
+ arguments.flatten.compact
+ end
+
# Returns arguments for lxc-start-ephemeral
#
# @return [Array<String>] An array of arguments for lxc-start-ephemeral
def clone_args
arguments = Array.new