[Feature] Move unit tests configs to one directory.
Remove unnecessary unit tests configs.
Remove zoneTemplatePrefix from daemon config (zoneTemplateDir is used instead).
Rename some configs.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests, run server.
Change-Id: Iabed6b7bfc1999296bcea89269195867d804c9ac
%attr(755,root,root) %{script_dir}/vsm_int_tests.py
%attr(755,root,root) %{script_dir}/vsm_launch_test.py
%{script_dir}/vsm_test_parser.py
-%config /etc/vasum/tests
-%attr(755,root,root) /etc/vasum/tests/templates
+%config /etc/vasum/tests/*.conf
+%config /etc/vasum/tests/dbus/*.conf
+%config /etc/vasum/tests/provision/*.conf
+%config /etc/vasum/tests/templates/*.conf
+%attr(755,root,root) /etc/vasum/tests/templates/*.sh
+%config /etc/vasum/tests/utils/*.txt
%{python_sitelib}/vsm_integration_tests
%config /etc/dbus-1/system.d/org.tizen.vasum.tests.conf
%{_unitdir}/vasum-socket-test.socket
"zoneTemplateDir" : "/etc/vasum/templates/",
"runMountPointPrefix" : "/var/run/zones",
"defaultId" : "",
- "zoneTemplatePrefix" : "/etc/vasum/templates",
"availableVTs" : [3, 4, 5, 6],
"inputConfig" : {"enabled" : true,
"device" : "gpio_keys.6",
ZoneAdmin::ZoneAdmin(const std::string& zoneId,
const std::string& zonesPath,
- const std::string& zoneTemplatePrefix,
+ const std::string& zoneTemplateDir,
const ZoneConfig& config,
const ZoneDynamicConfig& dynamicConfig)
: mConfig(config),
if (!mZone.isDefined()) {
const std::string zoneTemplate = utils::getAbsolutePath(config.zoneTemplate,
- zoneTemplatePrefix);
+ zoneTemplateDir);
LOGI(mId << ": Creating zone from template: " << zoneTemplate);
utils::CStringArrayBuilder args;
if (!dynamicConfig.ipv4Gateway.empty()) {
* ZoneAdmin constructor
* @param zoneId zone id
* @param zonesPath directory where zones are defined (configs, rootfs etc)
- * @param zoneTemplatePrefix directory where templates are stored
+ * @param zoneTemplateDir directory where templates are stored
* @param config zones config
* @param dynamicConfig zones dynamic config
*/
ZoneAdmin(const std::string& zoneId,
const std::string& zonesPath,
- const std::string& zoneTemplatePrefix,
+ const std::string& zoneTemplateDir,
const ZoneConfig& config,
const ZoneDynamicConfig& dynamicConfig);
virtual ~ZoneAdmin();
struct ZoneConfig {
/**
- * Zone template name (relative to zoneTemplatePrefix)
+ * Zone template name (relative to zoneTemplateDir)
*/
std::string zoneTemplate;
const std::string& zonesPath,
const std::string& zoneTemplatePath,
const std::string& dbPath,
- const std::string& zoneTemplatePrefix,
+ const std::string& zoneTemplateDir,
const std::string& baseRunMountPointPath)
: mDbPath(dbPath)
{
mRunMountPoint = fs::absolute(mDynamicConfig.runMountPoint, baseRunMountPointPath).string();
}
- mAdmin.reset(new ZoneAdmin(zoneId, zonesPath, zoneTemplatePrefix, mConfig, mDynamicConfig));
+ mAdmin.reset(new ZoneAdmin(zoneId, zonesPath, zoneTemplateDir, mConfig, mDynamicConfig));
const fs::path zonePath = fs::path(zonesPath) / zoneId;
mRootPath = (zonePath / fs::path("rootfs")).string();
* @param zonesPath directory where zones are defined (configs, rootfs etc)
* @param zoneTemplatePath path for zones config template
* @param dbPath path to dynamic config db file
- * @param zoneTemplatePrefix directory where templates are stored
+ * @param zoneTemplateDir directory where templates are stored
* @param baseRunMountPointPath base directory for run mount point
*/
Zone(const std::string& zoneId,
const std::string& zonesPath,
const std::string& zoneTemplatePath,
const std::string& dbPath,
- const std::string& zoneTemplatePrefix,
+ const std::string& zoneTemplateDir,
const std::string& baseRunMountPointPath);
Zone(const Zone&) = delete;
Zone& operator=(const Zone&) = delete;
std::string zoneTemplateDir;
/**
- * Path prefix for zone templates
- */
- std::string zoneTemplatePrefix;
-
- /**
* VTs available for zones
*/
std::vector<int> availableVTs;
zonesPath,
zoneImagePath,
zoneTemplateDir,
- zoneTemplatePrefix,
availableVTs,
inputConfig,
runMountPointPrefix,
mConfig.zonesPath,
zoneTemplatePath,
mConfig.dbPath,
- mConfig.zoneTemplatePrefix,
+ mConfig.zoneTemplateDir,
mConfig.runMountPointPrefix));
mZones.push_back(std::move(zone));
ADD_DEFINITIONS(-DVSM_TEST_CONFIG_INSTALL_DIR="${VSM_TEST_CONFIG_INSTALL_DIR}")
ADD_DEFINITIONS(-DVSM_TEST_TEMPLATES_INSTALL_DIR="${VSM_TEST_TEMPLATES_INSTALL_DIR}")
-ADD_SUBDIRECTORY(dbus/configs)
-ADD_SUBDIRECTORY(server/configs)
-ADD_SUBDIRECTORY(utils/configs)
-ADD_SUBDIRECTORY(client/configs)
-ADD_SUBDIRECTORY(lxc/templates)
-ADD_SUBDIRECTORY(socket_test_service/configs)
-
+ADD_SUBDIRECTORY(configs)
## Install #####################################################################
INSTALL(TARGETS ${UT_SERVER_CODENAME} DESTINATION bin)
+++ /dev/null
-# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file CMakeLists.txt
-# @author Mateusz Malicki (m.malicki2@samsung.com)
-#
-
-MESSAGE(STATUS "Installing configs for the Client Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
-
-## Generate ####################################################################
-CONFIGURE_FILE(ut-client/test-daemon.conf.in
- ${CMAKE_BINARY_DIR}/ut-client/test-daemon.conf @ONLY)
-FILE(GLOB client_manager_CONF_GEN ${CMAKE_BINARY_DIR}/ut-client/*.conf)
-
-CONFIGURE_FILE(ut-client/templates/console-dbus.conf.in
- ${CMAKE_BINARY_DIR}/ut-client/templates/console-dbus.conf @ONLY)
-CONFIGURE_FILE(ut-client/templates/console-ipc.conf.in
- ${CMAKE_BINARY_DIR}/ut-client/templates/console-ipc.conf @ONLY)
-FILE(GLOB client_templates_CONF_GEN ${CMAKE_BINARY_DIR}/ut-client/templates/*.conf)
-
-## Install #####################################################################
-INSTALL(FILES ${client_manager_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/client/ut-client)
-INSTALL(FILES ${client_templates_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/client/ut-client/templates)
namespace {
const std::string TEST_CONFIG_PATH =
- VSM_TEST_CONFIG_INSTALL_DIR "/client/ut-client/test-daemon.conf";
+ VSM_TEST_CONFIG_INSTALL_DIR "/test-daemon.conf";
const std::string ZONES_PATH = "/tmp/ut-zones"; // the same as in daemon.conf
const std::string TEMPLATE_NAME = "console-ipc";
--- /dev/null
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+# @file CMakeLists.txt
+# @author Dariusz Michaluk (d.michaluk@samsung.com)
+#
+
+MESSAGE(STATUS "Installing configs for the Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
+
+FILE(GLOB ut_zone_CONF *.conf)
+FILE(GLOB ut_zone_templates_CONF templates/*.conf
+ templates/*.sh)
+
+## Generate ####################################################################
+CONFIGURE_FILE(test-daemon.conf.in
+ ${CMAKE_BINARY_DIR}/test-daemon.conf @ONLY)
+FILE(GLOB ut_zone_CONF_GEN ${CMAKE_BINARY_DIR}/*.conf)
+
+CONFIGURE_FILE(templates/console-dbus.conf.in
+ ${CMAKE_BINARY_DIR}/templates/console-dbus.conf @ONLY)
+CONFIGURE_FILE(templates/console-ipc.conf.in
+ ${CMAKE_BINARY_DIR}/templates/console-ipc.conf @ONLY)
+FILE(GLOB ut_zone_templates_CONF_GEN ${CMAKE_BINARY_DIR}/templates/*.conf)
+
+
+## Install #####################################################################
+INSTALL(FILES ${ut_zone_CONF}
+ ${ut_zone_CONF_GEN}
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR})
+
+INSTALL(FILES ${ut_zone_templates_CONF}
+ ${ut_zone_templates_CONF_GEN}
+ DESTINATION ${VSM_TEST_TEMPLATES_INSTALL_DIR})
+
+INSTALL(FILES dbus/ut-dbus.conf
+ dbus/ut-dbus-system.conf
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/dbus)
+
+INSTALL(FILES provision/test-provision.conf
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/provision)
+
+INSTALL(FILES utils/file.txt
+ DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/utils)
+
+INSTALL(FILES systemd/vasum-socket-test.socket
+ systemd/vasum-socket-test.service
+ DESTINATION ${SYSTEMD_UNIT_DIR})
+
+INSTALL(FILES dbus-1/system.d/org.tizen.vasum.tests.conf
+ DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
+
{
- "zoneTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-zones-manager/ut-dbus.conf --fork; read"],
+ "zoneTemplate" : "minimal.sh",
+ "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/dbus/ut-dbus-system.conf --fork; read"],
"requestedState" : "running",
"ipv4Gateway" : "",
"ipv4" : "",
{
- "zoneTemplate" : "minimal-dbus.sh",
+ "zoneTemplate" : "minimal.sh",
"initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; read"],
"requestedState" : "running",
"ipv4Gateway" : "",
"requestedState" : "running",
"ipv4Gateway" : "",
"ipv4" : "",
- "privilege" : 10,
+ "privilege" : 20,
"vt" : -1,
"switchToDefaultAfterTimeout" : true,
"cpuQuotaForeground" : -1,
lxc.rootfs = ${rootfs}
# userns 1-to-1 mapping
-lxc.id_map = u 0 0 65536
-lxc.id_map = g 0 0 65536
+#lxc.id_map = u 0 0 65536
+#lxc.id_map = g 0 0 65536
lxc.haltsignal = SIGTERM
{
"dbPath" : "/tmp/ut-zones/vasum.db",
"zoneIds" : [],
- "defaultId" : "",
"zonesPath" : "/tmp/ut-zones",
"zoneImagePath" : "",
- "zoneTemplateDir" : "@VSM_TEST_CONFIG_INSTALL_DIR@/client/ut-client/templates/",
+ "zoneTemplateDir" : "@VSM_TEST_CONFIG_INSTALL_DIR@/templates/",
"runMountPointPrefix" : "",
- "zoneTemplatePrefix" : "@VSM_TEST_TEMPLATES_INSTALL_DIR@",
+ "defaultId" : "",
"availableVTs" : [],
"inputConfig" : {"enabled" : false,
- "device" : "/dev/doesnotexist",
+ "device" : "gpio-keys.4",
"code" : 139,
"numberOfEvents" : 2,
"timeWindowMs" : 500},
+++ /dev/null
-# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file CMakeLists.txt
-# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
-#
-
-MESSAGE(STATUS "Installing configs for the DBus Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
-FILE(GLOB dbus_CONF ut-connection/*.conf)
-
-
-## Install #####################################################################
-INSTALL(FILES ${dbus_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/dbus/ut-connection)
const char* DBUS_DAEMON_PROC = "/usr/bin/dbus-daemon";
const char* const DBUS_DAEMON_ARGS[] = {
DBUS_DAEMON_PROC,
- "--config-file=" VSM_TEST_CONFIG_INSTALL_DIR "/dbus/ut-connection/ut-dbus.conf",
+ "--config-file=" VSM_TEST_CONFIG_INSTALL_DIR "/dbus/ut-dbus.conf",
"--nofork",
NULL
};
+++ /dev/null
-# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file
-# @author Piotr Bartosiewicz (p.bartosiewi@partner.samsung.com)
-#
-
-FILE(GLOB ZONE_TEMPLATES *.sh)
-
-INSTALL(PROGRAMS ${ZONE_TEMPLATES}
- DESTINATION ${VSM_TEST_TEMPLATES_INSTALL_DIR})
+++ /dev/null
-#!/bin/bash
-
-echo UnitTest LXC template, args: $@
-
-options=$(getopt -o p:n: -l rootfs:,path:,name: -- "$@")
-if [ $? -ne 0 ]; then
- exit 1
-fi
-eval set -- "$options"
-
-while true
-do
- case "$1" in
- -p|--path) path=$2; shift 2;;
- --rootfs) rootfs=$2; shift 2;;
- -n|--name) name=$2; shift 2;;
- --) shift 1; break ;;
- *) break ;;
- esac
-done
-
-# Prepare zone rootfs
-ROOTFS_DIRS="\
-${rootfs}/bin \
-${rootfs}/dev \
-${rootfs}/dev/pts \
-${rootfs}/etc \
-${rootfs}/home \
-${rootfs}/lib \
-${rootfs}/lib64 \
-${rootfs}/proc \
-${rootfs}/root \
-${rootfs}/run \
-${rootfs}/sbin \
-${rootfs}/sys \
-${rootfs}/tmp \
-${rootfs}/usr \
-${rootfs}/opt
-"
-/bin/mkdir ${ROOTFS_DIRS}
-
-# Prepare zone configuration file
-> ${path}/config
-cat <<EOF >> ${path}/config
-lxc.utsname = ${name}
-lxc.rootfs = ${rootfs}
-
-# userns 1-to-1 mapping
-lxc.id_map = u 0 0 65536
-lxc.id_map = g 0 0 65536
-
-lxc.haltsignal = SIGTERM
-
-lxc.pts = 256
-lxc.tty = 0
-
-#lxc.loglevel = TRACE
-#lxc.logfile = /tmp/${name}.log
-
-lxc.cgroup.devices.deny = a
-
-lxc.mount.auto = proc sys cgroup
-lxc.mount.entry = /bin bin none ro,bind 0 0
-lxc.mount.entry = /etc etc none ro,bind 0 0
-lxc.mount.entry = /lib lib none ro,bind 0 0
-lxc.mount.entry = /sbin sbin none ro,bind 0 0
-lxc.mount.entry = /usr usr none ro,rbind 0 0
-lxc.mount.entry = /opt opt none ro,rbind 0 0
-EOF
-
-if [ "$(uname -m)" = "x86_64" ]; then
-cat <<EOF >> $path/config
-lxc.mount.entry = /lib64 lib64 none ro,bind 0 0
-EOF
-fi
-
+++ /dev/null
-# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file CMakeLists.txt
-# @author Jan Olszak (j.olszak@samsung.com)
-#
-
-MESSAGE(STATUS "Installing configs for the Server Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
-
-FILE(GLOB server_manager_CONF ut-server/*.conf)
-FILE(GLOB server_templates_CONF ut-server/templates/*.conf)
-
-FILE(GLOB manager_manager_CONF ut-zones-manager/*.conf)
-FILE(GLOB manager_templates_CONF ut-zones-manager/templates/*.conf)
-
-FILE(GLOB zone_CONF ut-zone/*.conf)
-FILE(GLOB zone_templates_CONF ut-zone/templates/*.conf)
-
-FILE(GLOB zone_provision_CONF ut-zone-provision/*.conf)
-
-FILE(GLOB admin_templates_CONF ut-zone-admin/templates/*.conf)
-
-
-## Generate ####################################################################
-CONFIGURE_FILE(ut-server/test-daemon.conf.in
- ${CMAKE_BINARY_DIR}/ut-server/test-daemon.conf @ONLY)
-FILE(GLOB server_manager_CONF_GEN ${CMAKE_BINARY_DIR}/ut-server/*.conf)
-
-CONFIGURE_FILE(ut-zone/templates/test-dbus.conf.in
- ${CMAKE_BINARY_DIR}/ut-zone/templates/test-dbus.conf @ONLY)
-FILE(GLOB zone_templates_CONF_GEN ${CMAKE_BINARY_DIR}/ut-zone/templates/*.conf)
-
-CONFIGURE_FILE(ut-zones-manager/test-daemon.conf.in
- ${CMAKE_BINARY_DIR}/ut-zones-manager/test-daemon.conf @ONLY)
-FILE(GLOB manager_manager_CONF_GEN ${CMAKE_BINARY_DIR}/ut-zones-manager/*.conf)
-
-FILE(GLOB manager_templates_CONF_GEN ${CMAKE_BINARY_DIR}/ut-zones-manager/templates/*.conf)
-
-
-## Install #####################################################################
-INSTALL(FILES ${server_manager_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
-INSTALL(FILES ${server_manager_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server)
-INSTALL(FILES ${server_templates_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-server/templates)
-
-INSTALL(FILES ${manager_manager_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zones-manager)
-INSTALL(FILES ${manager_manager_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zones-manager)
-INSTALL(FILES ${manager_templates_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zones-manager/templates)
-INSTALL(FILES ${manager_templates_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zones-manager/templates)
-
-INSTALL(FILES ${zone_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zone)
-INSTALL(FILES ${zone_templates_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zone/templates)
-INSTALL(FILES ${zone_templates_CONF_GEN}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zone/templates)
-
-INSTALL(FILES ${zone_provision_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zone-provision)
-
-INSTALL(FILES ${admin_templates_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/server/ut-zone-admin/templates)
-
-INSTALL(FILES dbus-1/system.d/org.tizen.vasum.tests.conf
- DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
+++ /dev/null
-{
- "zoneTemplate" : "minimal.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 20,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "",
- "provisions" : [],
- "permittedToSend" : [],
- "permittedToRecv" : [],
- "validLinkPrefixes" : []
-}
+++ /dev/null
-{
- "dbPath" : "/tmp/ut-zones/vasum.db",
- "zoneIds" : [],
- "zonesPath" : "/tmp/ut-zones",
- "zoneImagePath" : "",
- "zoneTemplateDir" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-server/templates/",
- "runMountPointPrefix" : "",
- "defaultId" : "",
- "zoneTemplatePrefix" : "@VSM_TEST_TEMPLATES_INSTALL_DIR@",
- "availableVTs" : [],
- "inputConfig" : {"enabled" : false,
- "device" : "gpio-keys.4",
- "code" : 139,
- "numberOfEvents" : 2,
- "timeWindowMs" : 500},
- "proxyCallRules" : []
-}
+++ /dev/null
-{
- "zoneTemplate" : "minimal.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 10,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "",
- "provisions" : [],
- "permittedToSend" : [],
- "permittedToRecv" : [],
- "validLinkPrefixes" : []
-}
+++ /dev/null
-{
- "zoneTemplate" : "minimal-dbus.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; /usr/bin/dbus-daemon --config-file=@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-zone/ut-dbus.conf --fork; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 10,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "/tmp/ut-run/zoneId",
- "provisions" : [],
- "permittedToSend" : [],
- "permittedToRecv" : [],
- "validLinkPrefixes" : []
-}
+++ /dev/null
-<!-- This configuration file controls the zones message bus -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
- <type>custom</type>
- <listen>unix:path=/var/run/dbus/system_bus_socket</listen>
-
- <policy context="default">
- <!-- Allow everything to be sent -->
- <allow send_destination="*" eavesdrop="true"/>
- <!-- Allow everything to be received -->
- <allow eavesdrop="true"/>
- <!-- Allow anyone to own anything -->
- <allow own="*"/>
- </policy>
-</busconfig>
+++ /dev/null
-{
- "zoneTemplate" : "minimal.sh",
- "initWithArgs" : ["/bin/sh", "-c", "trap exit SIGTERM; read"],
- "requestedState" : "running",
- "ipv4Gateway" : "",
- "ipv4" : "",
- "privilege" : 20,
- "vt" : -1,
- "switchToDefaultAfterTimeout" : true,
- "cpuQuotaForeground" : -1,
- "cpuQuotaBackground" : 1000,
- "shutdownTimeout" : 10,
- "runMountPoint" : "",
- "provisions" : [],
- "permittedToSend" : [ "/tmp/.*" ],
- "permittedToRecv" : [ "/tmp/.*" ],
- "validLinkPrefixes" : []
-}
+++ /dev/null
-{
- "dbPath" : "/tmp/ut-zones/vasum.db",
- "zoneIds" : [],
- "defaultId" : "",
- "zonesPath" : "/tmp/ut-zones",
- "zoneImagePath" : "",
- "zoneTemplateDir" : "@VSM_TEST_CONFIG_INSTALL_DIR@/server/ut-zones-manager/templates/",
- "runMountPointPrefix" : "",
- "zoneTemplatePrefix" : "@VSM_TEST_TEMPLATES_INSTALL_DIR@",
- "availableVTs" : [],
- "inputConfig" : {"enabled" : false,
- "device" : "/dev/doesnotexist",
- "code" : 139,
- "numberOfEvents" : 2,
- "timeWindowMs" : 500},
- "proxyCallRules" : [{"caller" : "*",
- "target" : "*",
- "targetBusName" : "org.tizen.vasum.tests",
- "targetObjectPath" : "*",
- "targetInterface" : "*",
- "targetMethod" : "*"}]
-}
namespace {
-const std::string CONFIG_DIR = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-server";
+const std::string CONFIG_DIR = VSM_TEST_CONFIG_INSTALL_DIR;
const std::string TEST_CONFIG_PATH = CONFIG_DIR + "/test-daemon.conf";
const std::string MISSING_CONFIG_PATH = CONFIG_DIR + "/missing-daemon.conf";
const std::string TEMPLATE_NAME = "default";
namespace {
-const std::string TEMPLATES_DIR = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-zone-admin/templates";
-const std::string TEST_CONFIG_PATH = TEMPLATES_DIR + "/test.conf";
+const std::string TEMPLATES_DIR = VSM_TEST_TEMPLATES_INSTALL_DIR;
+const std::string TEST_CONFIG_PATH = TEMPLATES_DIR + "/default.conf";
const std::string TEST_NO_SHUTDOWN_CONFIG_PATH = TEMPLATES_DIR + "/test-no-shutdown.conf";
-const std::string BUGGY_CONFIG_PATH = TEMPLATES_DIR + "/buggy.conf";
+const std::string BUGGY_CONFIG_PATH = TEMPLATES_DIR + "/buggy-init.conf";
const std::string MISSING_CONFIG_PATH = TEMPLATES_DIR + "/missing.conf";
const std::string ZONES_PATH = "/tmp/ut-zones";
-const std::string TEMPLATES_PATH = VSM_TEST_TEMPLATES_INSTALL_DIR;
struct Fixture {
utils::ScopedGlibLoop mLoop;
config::loadFromJsonFile(configPath, mDynamicConfig);
return std::unique_ptr<ZoneAdmin>(new ZoneAdmin("zoneId",
ZONES_PATH,
- TEMPLATES_PATH,
+ TEMPLATES_DIR,
mConfig,
mDynamicConfig));
}
namespace {
-const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-zone-provision/test.conf";
+const std::string TEST_CONFIG_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/provision/test-provision.conf";
const std::string ZONE = "ut-zone-provision-test";
const fs::path ZONES_PATH = "/tmp/ut-zones";
-const fs::path TEMPLATES_PATH = VSM_TEST_TEMPLATES_INSTALL_DIR;
const fs::path ZONE_PATH = ZONES_PATH / fs::path(ZONE);
const fs::path SOME_FILE_PATH = ZONE_PATH / "file.txt";
const fs::path ROOTFS_PATH = ZONE_PATH / "rootfs";
namespace {
-const std::string TEMPLATES_DIR = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-zone/templates";
-const std::string TEST_CONFIG_PATH = TEMPLATES_DIR + "/test.conf";
-const std::string TEST_DBUS_CONFIG_PATH = TEMPLATES_DIR + "/test-dbus.conf";
-const std::string BUGGY_CONFIG_PATH = TEMPLATES_DIR + "/buggy.conf";
-const std::string MISSING_CONFIG_PATH = TEMPLATES_DIR + "/missing.conf";
+const std::string TEMPLATES_DIR = VSM_TEST_TEMPLATES_INSTALL_DIR;
+const std::string TEST_CONFIG_PATH = TEMPLATES_DIR + "/default.conf";
+const std::string TEST_DBUS_CONFIG_PATH = TEMPLATES_DIR + "/console-dbus.conf";
+const std::string BUGGY_CONFIG_PATH = TEMPLATES_DIR + "/buggy-template.conf";
+const std::string MISSING_CONFIG_PATH = TEMPLATES_DIR + "/missing-config.conf";
const std::string ZONES_PATH = "/tmp/ut-zones";
-const std::string TEMPLATES_PATH = VSM_TEST_TEMPLATES_INSTALL_DIR;
const std::string DB_PATH = ZONES_PATH + "/vasum.db";
const std::string BRIDGE_NAME = "brtest01";
const std::string ZONE_NETDEV = "netdevtest01";
ZONES_PATH,
configPath,
DB_PATH,
- TEMPLATES_PATH,
+ TEMPLATES_DIR,
""));
}
namespace {
-const std::string CONFIG_DIR = VSM_TEST_CONFIG_INSTALL_DIR "/server/ut-zones-manager";
+const std::string CONFIG_DIR = VSM_TEST_CONFIG_INSTALL_DIR;
const std::string TEST_CONFIG_PATH = CONFIG_DIR + "/test-daemon.conf";
const std::string MISSING_CONFIG_PATH = CONFIG_DIR + "/missing-daemon.conf";
const int EVENT_TIMEOUT = 5000;
"Line 2\n";
const std::string NON_EXISTANT_ZONE_ID = "NON_EXISTANT_ZONE_ID";
const std::string ZONES_PATH = "/tmp/ut-zones"; // the same as in daemon.conf
-const std::string SIMPLE_TEMPLATE = "console";
+const std::string SIMPLE_TEMPLATE = "console-ipc";
#ifdef DBUS_CONNECTION
/**
+++ /dev/null
-# Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file CMakeLists.txt
-# @author Lukasz Kostyra (l.kostyra@samsung.com)
-#
-
-MESSAGE(STATUS "Installing configs for Vasum sycket test service to " ${VSM_TEST_CONFIG_INSTALL_DIR})
-
-## Install #####################################################################
-INSTALL(FILES systemd/vasum-socket-test.socket
- DESTINATION ${SYSTEMD_UNIT_DIR})
-INSTALL(FILES systemd/vasum-socket-test.service
- DESTINATION ${SYSTEMD_UNIT_DIR})
+++ /dev/null
-# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# @file CMakeLists.txt
-# @author Lukasz Pawelczyk (l.pawelczyk@partner.samsung.com)
-#
-
-MESSAGE(STATUS "Installing configs for the Utils Unit Tests to " ${VSM_TEST_CONFIG_INSTALL_DIR})
-FILE(GLOB fs_CONF ut-fs/*.txt)
-
-
-## Install #####################################################################
-INSTALL(FILES ${fs_CONF}
- DESTINATION ${VSM_TEST_CONFIG_INSTALL_DIR}/utils/ut-fs)
namespace {
const std::string TEST_PATH = "/tmp/ut-fsutils";
-const std::string REFERENCE_FILE_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/utils/ut-fs/file.txt";
+const std::string REFERENCE_FILE_PATH = VSM_TEST_CONFIG_INSTALL_DIR "/utils/file.txt";
const std::string REFERENCE_FILE_CONTENT = "File content\n"
"Line 1\n"
"Line 2\n";