IF(NOT DEFINED SECURITY_CONTAINERS_USER)
SET(SECURITY_CONTAINERS_USER "security-containers")
ENDIF(NOT DEFINED SECURITY_CONTAINERS_USER)
-IF(NOT DEFINED LIBVIRT_GROUP)
- SET(LIBVIRT_GROUP "libvirt")
-ENDIF(NOT DEFINED LIBVIRT_GROUP)
IF(NOT DEFINED INPUT_EVENT_GROUP)
SET(INPUT_EVENT_GROUP "input")
ENDIF(NOT DEFINED INPUT_EVENT_GROUP)
ENDIF(NOT DEFINED TTY_GROUP)
ADD_DEFINITIONS(-DSECURITY_CONTAINERS_USER="${SECURITY_CONTAINERS_USER}")
-ADD_DEFINITIONS(-DLIBVIRT_GROUP="${LIBVIRT_GROUP}")
ADD_DEFINITIONS(-DINPUT_EVENT_GROUP="${INPUT_EVENT_GROUP}")
ADD_DEFINITIONS(-DDISK_GROUP="${DISK_GROUP}")
ADD_DEFINITIONS(-DTTY_GROUP="${TTY_GROUP}")
# @author Mateusz Malicki (m.malicki2@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the command line interface...")
FILE(GLOB cli_SRCS *.cpp *.hpp)
# @author Mateusz Malicki (m.malicki2@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Client...")
FILE(GLOB project_SRCS *.cpp *.hpp *.h)
FILE(GLOB common_SRCS ${COMMON_FOLDER}/utils/callback-guard.hpp
# @author Jan Olszak (j.olszak@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Container Daemon...")
FILE(GLOB project_SRCS *.cpp *.hpp)
FILE(GLOB common_SRCS ${COMMON_FOLDER}/dbus/*.cpp ${COMMON_FOLDER}/dbus/*.hpp
# @author Piotr Bartosiewicz (p.bartosiewi@partner.samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Container Support...")
%define script_dir %{_sbindir}
# Security Containers Server's user info - it should already exist in the system
%define scs_user security-containers
-%define libvirt_group libvirt
# The group that has read and write access to /dev/input/event* devices.
# It may vary between platforms.
%define input_event_group input
%attr(755,root,root) %{_bindir}/security-containers-server
%dir /etc/security-containers
%dir /etc/security-containers/containers
-%dir /etc/security-containers/libvirt-config
-%dir /etc/security-containers/templates
%config /etc/security-containers/daemon.conf
%config /etc/security-containers/containers/*.conf
-%config /etc/security-containers/libvirt-config/*.xml
-%config /etc/security-containers/templates/*.conf
-%config /etc/security-containers/templates/*.xml
%{_unitdir}/security-containers.service
%{_unitdir}/multi-user.target.wants/security-containers.service
/etc/dbus-1/system.d/org.tizen.containers.host.conf
-DSYSTEMD_UNIT_DIR=%{_unitdir} \
-DPYTHON_SITELIB=%{python_sitelib} \
-DSECURITY_CONTAINERS_USER=%{scs_user} \
- -DLIBVIRT_GROUP=%{libvirt_group} \
-DINPUT_EVENT_GROUP=%{input_event_group} \
-DDISK_GROUP=%{disk_group} \
-DTTY_GROUP=%{tty_group}
# @author Jan Olszak (j.olszak@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Server...")
FILE(GLOB project_SRCS *.cpp *.hpp)
FILE(GLOB_RECURSE common_SRCS ${COMMON_FOLDER}/*.cpp ${COMMON_FOLDER}/*.hpp)
MESSAGE(STATUS "Installing configs to " ${SC_CONFIG_INSTALL_DIR})
FILE(GLOB container_CONF containers/*.conf)
-FILE(GLOB admin_CONF libvirt-config/*.xml)
-FILE(GLOB template_CONF templates/*.conf templates/*.xml)
## Generate ####################################################################
CONFIGURE_FILE(systemd/security-containers.service.in
INSTALL(FILES ${container_CONF}
DESTINATION ${SC_CONFIG_INSTALL_DIR}/containers)
-INSTALL(FILES ${admin_CONF}
- DESTINATION ${SC_CONFIG_INSTALL_DIR}/libvirt-config)
-
-INSTALL(FILES ${template_CONF}
- DESTINATION ${SC_CONFIG_INSTALL_DIR}/templates)
-
INSTALL(FILES ${CMAKE_BINARY_DIR}/systemd/security-containers.service
DESTINATION ${SYSTEMD_UNIT_DIR})
"privilege" : 1,
"vt" : 3,
"switchToDefaultAfterTimeout" : true,
- "config" : "../libvirt-config/business.xml",
- "networkConfig" : "../libvirt-config/business-network.xml",
- "networkFilterConfig" : "../libvirt-config/business-nwfilter.xml",
"runMountPoint" : "business/run",
"permittedToSend" : [ "/tmp/.*" ],
"permittedToRecv" : [ "/tmp/.*" ]
"privilege" : 10,
"vt" : 2,
"switchToDefaultAfterTimeout" : true,
- "config" : "../libvirt-config/private.xml",
- "networkConfig" : "../libvirt-config/private-network.xml",
- "networkFilterConfig" : "../libvirt-config/private-nwfilter.xml",
"runMountPoint" : "private/run",
"permittedToSend" : [ "/tmp/.*" ],
"permittedToRecv" : [ "/tmp/.*" ]
+++ /dev/null
-<network>
- <name>business</name>
- <uuid>cc0951f9-3397-4272-ae05-66c19229accf</uuid>
- <bridge name="virbr-business"/>
- <forward/>
- <dns forwardPlainNames="yes"/>
- <ip address="10.0.102.1" netmask="255.255.255.0">
- <dhcp>
- <range start="10.0.102.2" end="10.0.102.2"/>
- </dhcp>
- </ip>
-</network>
+++ /dev/null
-<filter name='nwfilter-business' chain='root'>
- <rule action='reject' direction='in' priority='100'>
- <ip srcipaddr='10.0.102.0' srcipmask='255.255.255.0'/>
- </rule>
- <rule action='reject' direction='out' priority='100'>
- <ip dstipaddr='10.0.102.0' srcipmask='255.255.255.0'/>
- </rule>
-</filter>
+++ /dev/null
-<domain type='lxc'>
- <name>business</name>
- <uuid>df00c906-c223-46bd-a49e-b573f694c3a5</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/lib/systemd/systemd</init>
- </os>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <console type='pty'/>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/fb0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty5</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event1</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mice</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mouse0</char>
- </source>
- </hostdev>
-
- <!--
- DLOG devices
- TODO: remove when dlogutil disappears
- -->
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_events</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_main</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_radio</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_system</char>
- </source>
- </hostdev>
-
- <interface type='network'>
- <source network='business'/>
- <filterref filter='nwfilter-business'/>
- </interface>
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/opt/usr/containers/business'/>
- <target dir='/'/>
- </filesystem>
- <!-- Enable access to the containers dbus -->
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/var/run/containers/business/run'/>
- <target dir='/var/run'/>
- </filesystem>
- <!-- Enable access to the SMACK labels -->
- <!-- TODO: This only helps investigating smack problems,
- and should be removed eventually -->
- <filesystem type='mount'>
- <source dir='/sys/fs/smackfs'/>
- <target dir='/sys/fs/smackfs'/>
- </filesystem>
- </devices>
-</domain>
+++ /dev/null
-<network>
- <name>private</name>
- <uuid>5b25f83d-ccb6-45f0-9d5c-c05199c261bd</uuid>
- <bridge name="virbr-private"/>
- <forward/>
- <dns forwardPlainNames="yes"/>
- <ip address="10.0.101.1" netmask="255.255.255.0">
- <dhcp>
- <range start="10.0.101.2" end="10.0.101.2"/>
- </dhcp>
- </ip>
-</network>
+++ /dev/null
-<filter name='nwfilter-private' chain='root'>
- <rule action='reject' direction='in' priority='100'>
- <ip srcipaddr='10.0.101.0' srcipmask='255.255.255.0'/>
- </rule>
- <rule action='reject' direction='out' priority='100'>
- <ip dstipaddr='10.0.101.0' srcipmask='255.255.255.0'/>
- </rule>
-</filter>
+++ /dev/null
-<domain type='lxc'>
- <name>private</name>
- <uuid>5890186c-0a85-4b27-bd0f-b3505c3bbea8</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/lib/systemd/systemd</init>
- </os>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <console type='pty'/>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/fb0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty5</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event1</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mice</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mouse0</char>
- </source>
- </hostdev>
-
- <!--
- DLOG devices
- TODO: remove when dlogutil disappears
- -->
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_events</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_main</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_radio</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_system</char>
- </source>
- </hostdev>
-
- <interface type='network'>
- <source network='private'/>
- <filterref filter='nwfilter-private'/>
- </interface>
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/opt/usr/containers/private'/>
- <target dir='/'/>
- </filesystem>
- <!-- Enable access to the containers dbus -->
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/var/run/containers/private/run'/>
- <target dir='/var/run'/>
- </filesystem>
- <!-- Enable access to the SMACK labels -->
- <!-- TODO: This only helps investigating smack problems,
- and should be removed eventually -->
- <filesystem type='mount'>
- <source dir='/sys/fs/smackfs'/>
- <target dir='/sys/fs/smackfs'/>
- </filesystem>
- </devices>
-</domain>
[Unit]
Description=Security Containers Server
-After=libvirtd.service
-Requires=libvirtd.service
ConditionVirtualization=no
[Service]
+++ /dev/null
-<network>
- <name>~NAME~</name>
- <uuid>~UUID~</uuid>
- <bridge name="virbr-~NAME~"/>
- <forward/>
- <dns forwardPlainNames="yes"/>
- <ip address="10.0.~IP~.1" netmask="255.255.255.0">
- <dhcp>
- <range start="10.0.~IP~.2" end="10.0.~IP~.2"/>
- </dhcp>
- </ip>
-</network>
+++ /dev/null
-<filter name='nwfilter-~NAME~' chain='root'>
- <uuid>~UUID~</uuid>
- <rule action='reject' direction='in' priority='100'>
- <ip srcipaddr='10.0.~IP~.0' srcipmask='255.255.255.0'/>
- </rule>
- <rule action='reject' direction='out' priority='100'>
- <ip dstipaddr='10.0.~IP~.0' srcipmask='255.255.255.0'/>
- </rule>
-</filter>
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/~NAME~.xml",
- "networkConfig" : "../libvirt-config/~NAME~-network.xml",
- "networkFilterConfig" : "../libvirt-config/~NAME~-nwfilter.xml",
"runMountPoint" : "~NAME~/run",
"permittedToSend" : [ "/tmp/.*" ],
"permittedToRecv" : [ "/tmp/.*" ]
+++ /dev/null
-<domain type='lxc'>
- <name>~NAME~</name>
- <uuid>~UUID~</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/lib/systemd/systemd</init>
- </os>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <console type='pty'/>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/fb0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/tty5</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event0</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event1</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event2</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event3</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/event4</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mice</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/input/mouse0</char>
- </source>
- </hostdev>
-
- <!--
- DLOG devices
- TODO: remove when dlogutil disappears
- -->
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_events</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_main</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_radio</char>
- </source>
- </hostdev>
- <hostdev mode='capabilities' type='misc'>
- <source>
- <char>/dev/log_system</char>
- </source>
- </hostdev>
-
- <interface type='network'>
- <source network='~NAME~'/>
- <filterref filter='nwfilter-~NAME~'/>
- </interface>
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/opt/usr/containers/~NAME~'/>
- <target dir='/'/>
- </filesystem>
- <!-- Enable access to the containers dbus -->
- <filesystem type='mount'>
- <!-- TODO: this directory could be generated from .conf files-->
- <source dir='/var/run/containers/~NAME~/run'/>
- <target dir='/var/run'/>
- </filesystem>
- <!-- Enable access to the SMACK labels -->
- <!-- TODO: This only helps investigating smack problems,
- and should be removed eventually -->
- <filesystem type='mount'>
- <source dir='/sys/fs/smackfs'/>
- <target dir='/sys/fs/smackfs'/>
- </filesystem>
- </devices>
-</domain>
bool enableDbusIntegration;
/**
- * Container's libvirt (XML) config file.
- * Location can be relative to the Container's config file.
- */
- std::string config;
-
- /**
- * Container's libvirt (XML) network config file.
- */
- std::string networkConfig;
-
- /**
- *
- * Container's libvirt (XML) network filter config file.
- */
- std::string networkFilterConfig;
-
- /**
* Container's CFS quota in us when it's in the foreground
*/
std::int64_t cpuQuotaForeground;
vt,
switchToDefaultAfterTimeout,
enableDbusIntegration,
- config,
- networkConfig,
- networkFilterConfig,
cpuQuotaForeground,
cpuQuotaBackground,
runMountPoint,
}
const std::string baseConfigPath = utils::dirName(containerConfigPath);
- mConfig.config = fs::absolute(mConfig.config, baseConfigPath).string();
- mConfig.networkConfig = fs::absolute(mConfig.networkConfig, baseConfigPath).string();
- mConfig.networkFilterConfig = fs::absolute(mConfig.networkFilterConfig,
- baseConfigPath).string();
+ //mConfig.config = fs::absolute(mConfig.config, baseConfigPath).string();
+ //mConfig.networkConfig = fs::absolute(mConfig.networkConfig, baseConfigPath).string();
+ //mConfig.networkFilterConfig = fs::absolute(mConfig.networkFilterConfig,
+ // baseConfigPath).string();
if (!mConfig.runMountPoint.empty()) {
mRunMountPoint = fs::absolute(mConfig.runMountPoint, baseRunMountPointPath).string();
}
- LOGT("Creating Network Admin " << mConfig.networkConfig);
+ //LOGT("Creating Network Admin " << mConfig.networkConfig);
mNetworkAdmin.reset(new NetworkAdmin(mConfig));
- LOGT("Creating Container Admin " << mConfig.config);
+ //LOGT("Creating Container Admin " << mConfig.config);
mAdmin.reset(new ContainerAdmin(mConfig));
}
const std::string HOST_ID = "host";
const std::string CONTAINER_TEMPLATE_CONFIG_PATH = "template.conf";
-const std::string CONTAINER_TEMPLATE_LIBVIRT_CONFIG_PATH = "template.xml";
-const std::string CONTAINER_TEMPLATE_LIBVIRT_NETWORK_PATH = "template-network.xml";
-const std::string CONTAINER_TEMPLATE_LIBVIRT_NETWORK_FILTER_PATH = "template-nwfilter.xml";
const boost::regex CONTAINER_NAME_REGEX("~NAME~");
const boost::regex CONTAINER_UUID_REGEX("~UUID~");
std::string configPath = utils::createFilePath(templateDir, "/", CONTAINER_TEMPLATE_CONFIG_PATH);
std::string newConfigPath = utils::createFilePath(configDir, "/containers/", id + ".conf");
- std::string libvirtConfigPath = utils::createFilePath(templateDir, "/", CONTAINER_TEMPLATE_LIBVIRT_CONFIG_PATH);
- std::string newLibvirtConfigPath = utils::createFilePath(configDir, "/libvirt-config/", id + ".xml");
- std::string libvirtNetworkPath = utils::createFilePath(templateDir, "/", CONTAINER_TEMPLATE_LIBVIRT_NETWORK_PATH);
- std::string newLibvirtNetworkPath = utils::createFilePath(configDir, "/libvirt-config/", id + "-network.xml");
- std::string libvirtNetworkFilterPath = utils::createFilePath(templateDir, "/", CONTAINER_TEMPLATE_LIBVIRT_NETWORK_FILTER_PATH);
- std::string newLibvirtNetworkFilterPath = utils::createFilePath(configDir, "/libvirt-config/", id + "-nwfilter.xml");
auto removeAllWrapper = [](const std::string& path) {
try {
LOGI("Generating config from " << configPath << " to " << newConfigPath);
generateNewConfig(id, configPath, newConfigPath);
- LOGI("Generating config from " << libvirtConfigPath << " to " << newLibvirtConfigPath);
- generateNewConfig(id, libvirtConfigPath, newLibvirtConfigPath);
-
- LOGI("Generating config from " << libvirtNetworkPath << " to " << newLibvirtNetworkPath);
- generateNewConfig(id, libvirtNetworkPath, newLibvirtNetworkPath);
-
- LOGI("Generating config from " << libvirtNetworkFilterPath << " to " << newLibvirtNetworkFilterPath);
- generateNewConfig(id, libvirtNetworkFilterPath, newLibvirtNetworkFilterPath);
} catch (SecurityContainersException& e) {
LOGE(e.what());
removeAllWrapper(containerPathStr);
#error "INPUT_EVENT_GROUP must be defined!"
#endif
-#ifndef LIBVIRT_GROUP
-#error "LIBVIRT_GROUP must be defined!"
-#endif
-
#ifndef DISK_GROUP
#error "DISK_GROUP must be defined!"
#endif
return true;
}
- // LIBVIRT_GROUP provides access to libvirt's daemon socket.
// INPUT_EVENT_GROUP provides access to /dev/input/event* devices used by InputMonitor.
// DISK_GROUP provides access to /dev/loop* devices, needed when adding new container to copy
// containers image
- if (!utils::setSuppGroups({LIBVIRT_GROUP, INPUT_EVENT_GROUP, DISK_GROUP, TTY_GROUP})) {
+ if (!utils::setSuppGroups({INPUT_EVENT_GROUP, DISK_GROUP, TTY_GROUP})) {
return false;
}
# @author Lukasz Kostyra (l.kostyra@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for Integration Tests...")
# @author Jan Olszak (j.olszak@samsung.com)
#
+MESSAGE(STATUS "")
MESSAGE(STATUS "Generating makefile for the Unit Tests...")
FILE(GLOB_RECURSE project_SRCS *.cpp *.hpp)
FILE(GLOB_RECURSE common_SRCS ${COMMON_FOLDER}/*.cpp ${COMMON_FOLDER}/*.hpp)
# @author Mateusz Malicki (m.malicki2@samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Client Unit Tests to " ${SC_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Client Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB client_manager_CONF ut-client/*.conf)
FILE(GLOB client_container_CONF ut-client/containers/*.conf)
-FILE(GLOB client_admin_CONF ut-client/libvirt-config/*.xml)
## Generate ####################################################################
-CONFIGURE_FILE(ut-client/libvirt-config/console1-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-client/libvirt-config/console1-dbus.xml @ONLY)
-CONFIGURE_FILE(ut-client/libvirt-config/console2-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-client/libvirt-config/console2-dbus.xml @ONLY)
-CONFIGURE_FILE(ut-client/libvirt-config/console3-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-client/libvirt-config/console3-dbus.xml @ONLY)
-FILE(GLOB client_admin_CONF_GEN ${CMAKE_BINARY_DIR}/ut-client/libvirt-config/*.xml)
-
## Install #####################################################################
INSTALL(FILES ${client_manager_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client)
INSTALL(FILES ${client_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client/containers)
-INSTALL(FILES ${client_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client/libvirt-config)
-INSTALL(FILES ${client_admin_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/client/ut-client/libvirt-config)
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console1-dbus.xml",
- "networkConfig" : "../libvirt-config/network1.xml",
- "networkFilterConfig" : "../libvirt-config/network1-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console1-dbus",
"vt" : -1,
"switchToDefaultAfterTimeout" : false,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console2-dbus.xml",
- "networkConfig" : "../libvirt-config/network2.xml",
- "networkFilterConfig" : "../libvirt-config/network2-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console2-dbus",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console3-dbus.xml",
- "networkConfig" : "../libvirt-config/network3.xml",
- "networkFilterConfig" : "../libvirt-config/network3-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console3-dbus",
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console1-dbus</name>
- <uuid>58184009-b278-4d01-975d-708393690084</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console1-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console2-dbus</name>
- <uuid>3d18323e-4ada-4a1b-a907-836701891306</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console2-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console3-dbus</name>
- <uuid>71cb8511-7474-4e90-865a-3360b7f77254</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console3-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<filter name='test-network-1-filter' chain='root'>
- <uuid>abc79a77-0209-41a2-ab82-f767dfa5897e</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-1</name>
- <uuid>372720ef-258b-4b27-baf6-d08341b15353</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-2-filter' chain='root'>
- <uuid>703f53eb-c602-4383-9de9-62bbe843ba31</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-2</name>
- <uuid>95b9c647-ed3f-4586-886e-0a7b24e683a8</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-3-filter' chain='root'>
- <uuid>40943fcc-faec-4bfe-9e89-104945164d35</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-3</name>
- <uuid>962b061d-7f3e-410b-8990-3f1267d77656</uuid>
-</network>
# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
#
-MESSAGE(STATUS "Installing configs for the DBus Unit Tests to " ${SC_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the DBus Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB dbus_CONF ut-connection/*.conf)
# @author Jan Olszak (j.olszak@samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Server Unit Tests to " ${SC_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Server Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB server_manager_CONF ut-server/*.conf)
FILE(GLOB server_container_CONF ut-server/containers/*.conf)
-FILE(GLOB server_admin_CONF ut-server/libvirt-config/*.xml)
FILE(GLOB manager_manager_CONF ut-containers-manager/*.conf)
FILE(GLOB manager_container_CONF ut-containers-manager/containers/*.conf)
-FILE(GLOB manager_admin_CONF ut-containers-manager/libvirt-config/*.xml)
-FILE(GLOB manager_admin_TEMPLATE ut-containers-manager/templates/*.conf
- ut-containers-manager/templates/*.xml)
+FILE(GLOB manager_admin_TEMPLATE ut-containers-manager/templates/*.conf)
FILE(GLOB container_CONF ut-container/*.conf)
FILE(GLOB container_container_CONF ut-container/containers/*.conf)
-FILE(GLOB container_admin_CONF ut-container/libvirt-config/*.xml)
FILE(GLOB admin_container_CONF ut-container-admin/containers/*.conf)
-FILE(GLOB admin_admin_CONF ut-container-admin/libvirt-config/*.xml)
FILE(GLOB network_container_CONF ut-network-admin/containers/*.conf)
-FILE(GLOB network_admin_CONF ut-network-admin/libvirt-config/*.xml)
FILE(GLOB connection_CONF ut-container-connection/*.conf)
${CMAKE_BINARY_DIR}/ut-network-admin/containers/buggy.conf @ONLY)
FILE(GLOB network_container_CONF_GEN ${CMAKE_BINARY_DIR}/ut-network-admin/containers/*.conf)
-CONFIGURE_FILE(ut-containers-manager/libvirt-config/console1-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-containers-manager/libvirt-config/console1-dbus.xml @ONLY)
-CONFIGURE_FILE(ut-containers-manager/libvirt-config/console2-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-containers-manager/libvirt-config/console2-dbus.xml @ONLY)
-CONFIGURE_FILE(ut-containers-manager/libvirt-config/console3-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-containers-manager/libvirt-config/console3-dbus.xml @ONLY)
-CONFIGURE_FILE(ut-containers-manager/templates/template.xml.in
- ${CMAKE_BINARY_DIR}/ut-containers-manager/templates/template.xml @ONLY)
-FILE(GLOB manager_admin_CONF_GEN ${CMAKE_BINARY_DIR}/ut-containers-manager/libvirt-config/*.xml)
-FILE(GLOB manager_admin_TEMPLATE_GEN ${CMAKE_BINARY_DIR}/ut-containers-manager/templates/*.xml)
-
-CONFIGURE_FILE(ut-container/libvirt-config/test-dbus.xml.in
- ${CMAKE_BINARY_DIR}/ut-container/libvirt-config/test-dbus.xml @ONLY)
-FILE(GLOB container_admin_CONF_GEN ${CMAKE_BINARY_DIR}/ut-container/libvirt-config/*.xml)
-
## Install #####################################################################
INSTALL(FILES ${server_manager_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
INSTALL(FILES ${server_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server/containers)
-INSTALL(FILES ${server_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-server/libvirt-config)
INSTALL(FILES ${manager_manager_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager)
INSTALL(FILES ${manager_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/containers)
-INSTALL(FILES ${manager_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/libvirt-config)
-INSTALL(FILES ${manager_admin_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/libvirt-config)
INSTALL(FILES ${manager_admin_TEMPLATE}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/templates)
-INSTALL(FILES ${manager_admin_TEMPLATE_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-containers-manager/templates)
INSTALL(FILES ${container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container)
INSTALL(FILES ${container_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container/containers)
-INSTALL(FILES ${container_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container/libvirt-config)
-INSTALL(FILES ${container_admin_CONF_GEN}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container/libvirt-config)
INSTALL(FILES ${admin_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-admin/containers)
INSTALL(FILES ${admin_container_CONF_GEN}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-admin/containers)
-INSTALL(FILES ${admin_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-admin/libvirt-config)
INSTALL(FILES ${network_container_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-network-admin/containers)
INSTALL(FILES ${network_container_CONF_GEN}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-network-admin/containers)
-INSTALL(FILES ${network_admin_CONF}
- DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-network-admin/libvirt-config)
INSTALL(FILES ${connection_CONF}
DESTINATION ${SC_TEST_CONFIG_INSTALL_DIR}/server/ut-container-connection)
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-container-admin/libvirt-config/buggy.xml",
- "networkConfig" : "",
- "networkFilterConfig" : "",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "/this/is/a/missing/file/path/missing.xml",
- "networkConfig" : "",
- "networkFilterConfig" : "",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-container-admin/libvirt-config/test-no-shutdown.xml",
- "networkConfig" : "",
- "networkFilterConfig" : "",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-container-admin/libvirt-config/test.xml",
- "networkConfig" : "",
- "networkFilterConfig" : "",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
+++ /dev/null
-<><TRASHXML>
+++ /dev/null
-<domain type="lxc">
- <name>ut-container-admin-test</name>
- <uuid>f6924d8d-faa4-4cd3-8b47-383f45a4c0c8</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-container-admin-test</name>
- <uuid>a1299273-bce2-4d1f-8369-54b75a791279</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "/missing/file/path/libvirt.xml",
- "networkConfig" : "../libvirt-config/network.xml",
- "networkFilterConfig" : "../libvirt-config/network-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/test-dbus.xml",
- "networkConfig" : "../libvirt-config/network.xml",
- "networkFilterConfig" : "../libvirt-config/network-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-container",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/test.xml",
- "networkConfig" : "../libvirt-config/network.xml",
- "networkFilterConfig" : "../libvirt-config/network-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
+++ /dev/null
-<filter name='test_network_filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0008</uuid>
-</filter>
-
+++ /dev/null
-<network>
- <name>test_network</name>
- <uuid>6c4977c0-90f3-46eb-98ec-0bcf95619e67</uuid>
-</network>
+++ /dev/null
-<domain type="lxc">
- <name>ut-container-test-dbus</name>
- <uuid>35bb7989-f222-4b63-b0b1-facbdb05b495</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-container/ut-dbus.conf --fork; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <filesystem type='mount'>
- <source dir='/tmp/ut-container'/>
- <target dir='/var/run'/>
- </filesystem>
- <interface type='network'>
- <source network='test_network'/>
- <filterref filter='test_network_filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-container-test</name>
- <uuid>be2e7a5e-c59f-4264-aeab-390cedf47922</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test_network'/>
- <filterref filter='test_network_filter'/>
- </interface>
- </devices>
-</domain>
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console1-dbus.xml",
- "networkConfig" : "../libvirt-config/network1.xml",
- "networkFilterConfig" : "../libvirt-config/network1-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console1-dbus",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/console1.xml",
- "networkConfig" : "../libvirt-config/network1.xml",
- "networkFilterConfig" : "../libvirt-config/network1-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : false,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console2-dbus.xml",
- "networkConfig" : "../libvirt-config/network2.xml",
- "networkFilterConfig" : "../libvirt-config/network2-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console2-dbus",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/console2.xml",
- "networkConfig" : "../libvirt-config/network2.xml",
- "networkFilterConfig" : "../libvirt-config/network2-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
- "config" : "../libvirt-config/console3-dbus.xml",
- "networkConfig" : "../libvirt-config/network3.xml",
- "networkFilterConfig" : "../libvirt-config/network3-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/console3-dbus",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/console3.xml",
- "networkConfig" : "../libvirt-config/network3.xml",
- "networkFilterConfig" : "../libvirt-config/network3-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console1-dbus</name>
- <uuid>58184009-b278-4d01-975d-708393690084</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console1-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console1</name>
- <uuid>d0404a44-426b-40ea-af79-dec41400596f</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-1'/>
- <filterref filter='test-network-1-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console2-dbus</name>
- <uuid>3d18323e-4ada-4a1b-a907-836701891306</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console2-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console2</name>
- <uuid>a51ff2fa-cad1-47f8-adbc-09fa5700817a</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-2'/>
- <filterref filter='test-network-2-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console3-dbus</name>
- <uuid>71cb8511-7474-4e90-865a-3360b7f77254</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/console3-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-containers-manager-console3</name>
- <uuid>a36f0f39-097e-49fa-a4c9-124b622fba8d</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-3'/>
- <filterref filter='test-network-3-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<filter name='test-network-1-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0003</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-1</name>
- <uuid>372720ef-258b-4b27-baf6-d08341b15353</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-2-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0002</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-2</name>
- <uuid>95b9c647-ed3f-4586-886e-0a7b24e683a8</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-3-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0004</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-3</name>
- <uuid>962b061d-7f3e-410b-8990-3f1267d77656</uuid>
-</network>
+++ /dev/null
-<network>
- <name>~NAME~-network</name>
- <uuid>~UUID~</uuid>
-</network>
+++ /dev/null
-<filter name='nwfilter-~NAME~' chain='root'>
- <uuid>~UUID~</uuid>
-</filter>
"privilege" : 20,
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
- "config" : "../libvirt-config/~NAME~.xml",
- "networkConfig" : "../libvirt-config/~NAME~-network.xml",
- "networkFilterConfig" : "../libvirt-config/~NAME~-nwfilter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "/tmp/ut-containers-manager/~NAME~-dbus",
+++ /dev/null
-<domain type="lxc">
- <name>~NAME~</name>
- <uuid>~UUID~</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/usr/bin/dbus-daemon</init>
- <initarg>--nofork</initarg>
- <initarg>--config-file=@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-containers-manager/ut-dbus.conf</initarg>
- <initarg>--address=unix:path=/tmp/ut-containers-manager/~NAME~-dbus/dbus/system_bus_socket</initarg>
- </os>
- <devices>
- <console type="pty"/>
- </devices>
-</domain>
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "",
- "networkConfig" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-network-admin/libvirt-config/buggy-network.xml",
- "networkFilterConfig" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-network-admin/libvirt-config/buggy-network-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "",
- "networkConfig" : "",
- "networkFilterConfig" : "",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "",
- "networkConfig" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-network-admin/libvirt-config/network.xml",
- "networkFilterConfig" : "@SC_TEST_CONFIG_INSTALL_DIR@/server/ut-network-admin/libvirt-config/network-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
+++ /dev/null
-<><TRASHXML>
+++ /dev/null
-<><TRASHXML>
+++ /dev/null
-<filter name='test_network_filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0001</uuid>
-</filter>
-
+++ /dev/null
-<network>
- <name>test_network</name>
- <uuid>e377280a-06b0-40ee-8042-707481af34de</uuid>
-</network>
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/container1.xml",
- "networkConfig" : "../libvirt-config/network1.xml",
- "networkFilterConfig" : "../libvirt-config/network1-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/container2.xml",
- "networkConfig" : "../libvirt-config/network2.xml",
- "networkFilterConfig" : "../libvirt-config/network2-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : false,
- "config" : "../libvirt-config/container3.xml",
- "networkConfig" : "../libvirt-config/network3.xml",
- "networkFilterConfig" : "../libvirt-config/network3-filter.xml",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"runMountPoint" : "",
+++ /dev/null
-<domain type="lxc">
- <name>ut-server-container1</name>
- <uuid>ad0785fb-33d7-468d-83a3-948e57418f95</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-1'/>
- <filterref filter='test-network-1-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-server-container2</name>
- <uuid>1f8ddc96-511f-476c-8491-141ba6dfdfab</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-2'/>
- <filterref filter='test-network-2-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<domain type="lxc">
- <name>ut-server-container3</name>
- <uuid>42b4984e-a3f3-4c25-add0-21786594d1e9</uuid>
- <memory>102400</memory>
- <os>
- <type>exe</type>
- <init>/bin/sh</init>
- <initarg>-c</initarg>
- <initarg>trap exit SIGTERM; read</initarg>
- </os>
- <devices>
- <console type="pty"/>
- <interface type='network'>
- <source network='test-network-3'/>
- <filterref filter='test-network-3-filter'/>
- </interface>
- </devices>
-</domain>
+++ /dev/null
-<filter name='test-network-1-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0006</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-1</name>
- <uuid>9df94a88-ab94-4750-98f6-54befefc9ebb</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-2-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0005</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-2</name>
- <uuid>e471be8c-7687-4e19-8bb0-c0a448e1e975</uuid>
-</network>
+++ /dev/null
-<filter name='test-network-3-filter' chain='root'>
- <uuid>37ec6a98-a8f2-4033-8146-a71deb1f0007</uuid>
-</filter>
+++ /dev/null
-<network>
- <name>test-network-3</name>
- <uuid>188e15f0-4176-4f93-a113-1a9640de6b66</uuid>
-</network>
const std::string BUGGY_FOREGROUND_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-foreground-daemon.conf";
const std::string BUGGY_DEFAULTID_CONFIG_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/buggy-default-daemon.conf";
const std::string TEST_CONTAINER_CONF_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/containers/";
-const std::string TEST_CONTAINER_LIBVIRT_CONF_PATH = SC_TEST_CONFIG_INSTALL_DIR "/server/ut-containers-manager/libvirt-config/";
const std::string MISSING_CONFIG_PATH = "/this/is/a/missing/file/path/missing-daemon.conf";
const int EVENT_TIMEOUT = 5000;
const int TEST_DBUS_CONNECTION_CONTAINERS_COUNT = 3;
const std::string newContainerId = "test1234";
const std::vector<std::string> newContainerConfigs = {
TEST_CONTAINER_CONF_PATH + newContainerId + ".conf",
- TEST_CONTAINER_LIBVIRT_CONF_PATH + newContainerId + ".xml",
- TEST_CONTAINER_LIBVIRT_CONF_PATH + newContainerId + "-network.xml",
- TEST_CONTAINER_LIBVIRT_CONF_PATH + newContainerId + "-nwfilter.xml",
};
FileCleanerRAII cleaner(newContainerConfigs);
# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
#
-MESSAGE(STATUS "Installing configs for the Utils Unit Tests to " ${SC_CONFIG_INSTALL_DIR})
+MESSAGE(STATUS "Installing configs for the Utils Unit Tests to " ${SC_TEST_CONFIG_INSTALL_DIR})
FILE(GLOB fs_CONF ut-fs/*.txt)