summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Piotr Bartosiewicz [Thu, 15 May 2014 11:24:26 +0000 (13:24 +0200)]
Mount smackfs into containers
[Bug/Feature] There were no possibilities to check SMACK labels being
inside the container
[Cause] Smackfs was not mounted
[Solution] N/A
[Verification] Build, install, check the result of command:
ls -1Z # (inside container)
Should output labels, not '?'
Change-Id: I8aaf961b05e87725df85b6031efb60c45142b977
Lukasz Kostyra [Mon, 28 Apr 2014 11:06:41 +0000 (13:06 +0200)]
Reload SCS binary when updating security-containers
[Feature] Reload SCS without turning containers off when binary is updated.
[Cause] When updating SCS we don't want to restart containers, only SCS itself.
[Solution] Add SIGUSR1 handling which will tell SCS to keep containers alive when exiting.
Add check in ContainerConnectionTransport if containers are running to skip remount
of tmpfs when it is not needed.
[Verification] Build, install, reboot target. Test the following when SCS is running together with
containers active:
* Call "systemctl stop security-containers". SCS should turn off and containers
should turn off as well. Call "systemctl start security-containers", SCS and
containers should start up.
* Simulate update by calling "kill -USR1 `pidof security-containers-server`". SCS
should properly reload, however containers should stay on. (note - the best way
to check it would be by verifying logs in journalctl).
Change-Id: I3a6d0fb25a4579208ad0f6d0de00e2755548230e
Signed-off-by: Lukasz Kostyra <l.kostyra@samsung.com>
Casey Schaufler [Mon, 19 May 2014 16:53:30 +0000 (09:53 -0700)]
Merge "Make Security Containers Server a systemd service" into tizen
Michal Witanowski [Wed, 16 Apr 2014 09:26:06 +0000 (11:26 +0200)]
Make Security Containers Server a systemd service
[Bug/Feature] Create systemd service for SCS launching.
[Cause] N/A
[Solution] * Needed configs and scripts have been written.
* "post" and "postun" sections of the spec file have been filled.
[Verification] Build and install on a target that has:
* "business" and "private" root filesystems located
at /opt/usr/containers/
* libvirtd running as systemd service
After the installation, verify:
1. Stopping/starting the service via "systemctl stop/start
security-containers.service".
2. Restarting the device (the containers should boot
automatically).
3. Killing the Security Containers Server (for example:
"kill -11 `pidof security-containers-server`")
- the service should restart in this situation.
4. Uninstalling the Security Containers package
- the containers should keep on running since next reboot.
5. Upgrading should send SIGUSR1 to the daemon (it will be handled
by another commit).
Change-Id: I514cc4c447e0f100022b80e2149fc3e228aa5f8a
Signed-off-by: Michal Witanowski <m.witanowski@samsung.com>
Lukasz Pawelczyk [Mon, 19 May 2014 11:17:47 +0000 (13:17 +0200)]
Unit tests for ContainerAdmin using and testing the listeners
[Bug/Feature] Revamped tests for ContainerAdmin.
[Cause] N/A
[Solution] They use and test Listeners.
New test for the stop() procedure.
[Verification] Built, installed and run tests.
Change-Id: I76c0a3871298855b8cbdcddbd21e8421887d34ed
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Pawelczyk [Thu, 8 May 2014 10:24:42 +0000 (12:24 +0200)]
Add libvirt's event listeners and use them to implement a graceful stop
[Bug/Feature] Orginize container's shutdown process
[Cause] Burdello
[Solution] Implemented listeners for libvirt's events (lifecycle and reboot)
Added libvirt-glib dependency to use glib main loop for those events.
Used those listeners to implement a synchronous graceful stop of
the container: "try to shutdown, if it wont in 10 seconds, destroy it".
Added thread ID to the logger.
Organized container related logs a little.
[Verification] Built, installed, run tests and the daemon.
Change-Id: I3be53a2a46cd130cf414e89b0c47eb1cce74e6b5
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Thu, 15 May 2014 10:11:18 +0000 (12:11 +0200)]
Add SMACK manifests
[Bug/Feature] Manifests were not present
[Cause] N/A
[Solution] N/A
[Verification] Build, install, verity on target using command:
rpm -q --qf '%{SECMANIFEST}' pkg_name | base64 -d
where pkg_name is all of our security-containers*
Change-Id: I134055ea328b0f8b76e090dc33b1a3152d96dd0f
Jan Olszak [Wed, 14 May 2014 14:41:27 +0000 (16:41 +0200)]
Parsing LogLevel in the Logger
[Bug/Feature] No way to initialize LogLevel with a string value
[Cause] N/A
[Solution] Added parsing of LogLevel from std::string
[Verification] Build, install and run tests
Change-Id: I1f1dada51d0a131d13aa21d6e49e6c4d37ee0f25
Jan Olszak [Thu, 8 May 2014 14:00:07 +0000 (16:00 +0200)]
Introduced Container Daemon
[Bug/Feature] No way to run arbitrary code in a container
[Cause] N/A
[Solution] Introduced Container Daemon that provides his API
in system dbus of the container.
[Verification] Build, install run security-containers-container-daemon
dbus-send --system --dest=com.samsung.container.daemon \
--type=method_call --print-reply \
/com/samsung/container/daemon \
com.samsung.container.daemon.GainFocus
dbus-send --system --dest=com.samsung.container.daemon \
--type=method_call --print-reply \
/com/samsung/container/daemon \
com.samsung.container.daemon.LoseFocus
Change-Id: I557ca0b283f8c542d45238ec0183ee953a277d5e
Piotr Bartosiewicz [Thu, 8 May 2014 10:16:17 +0000 (12:16 +0200)]
Remove some minor clang warnings
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I0afb654f036c46a11946faadaa62dc5bb831d4d6
Lukasz Pawelczyk [Tue, 6 May 2014 10:42:28 +0000 (12:42 +0200)]
Handle reconnecting to the dbus, add glib helper
[Bug/Feature] Handle reconnecting to the dbus in case of the
connection loss. Also add a Glib helper for
scheduling a timer function to the glib loop.
Style cosmetics.
[Cause] In case the DBUS daemon gets restarted we loose
connection, we need to handle that case.
[Solution] Detect nameLost event and react appropriately.
[Verification] Built, installed, run tests.
The reconnect has been tested by hand as follows:
1. Run the security-containers-server
2. Make sure it started properly
3. Enter the container and restart dbus
4. See SCS logs, make sure it reconnected
5. Enter the container stop dbus and dbus.socket
6. See SCS logs, make sure the container stopped
Change-Id: I1185d8d46e0ace8e96b4d4136fbca20bd603bea9
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Thu, 8 May 2014 10:37:20 +0000 (12:37 +0200)]
Fix config type of cpu quota
[Bug/Feature] Type in config was double instead of int64
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I77ee8fd87faf798a21d2327cb6955be3482e78a0
Lukasz Pawelczyk [Mon, 5 May 2014 12:16:42 +0000 (14:16 +0200)]
Minor changes to ContainerConnection
[Bug/Feature] ContainerConnection lifecycle is tied with a connection's lifecycle,
OnNameLost callback added.
[Cause] Be consistent, OnNameLost callback will be required to handle disconnections
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: Ie43eda2a4774ef003bee9ed877b6caab041035ba
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Mon, 28 Apr 2014 12:05:46 +0000 (14:05 +0200)]
Include system headers as system
[Bug/Feature] Warnings in system headers should be silenced
[Cause] N/A
[Solution] N/A
[Verification] Build project
Change-Id: Id966ef78e736e98963d156d6d45e399bfe55a982
Piotr Bartosiewicz [Mon, 28 Apr 2014 11:11:32 +0000 (13:11 +0200)]
Don't use deprecated json api
[Bug/Feature] Compilation ploblems (-Werror=deprecated-declarations)
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: Ied61192ca331485c9ff579853053faa8caf959b3
Piotr Bartosiewicz [Fri, 25 Apr 2014 14:04:31 +0000 (16:04 +0200)]
Split ContainerConnection into two classes
[Bug/Feature] ContainerConnection had two separate functionalities
[Cause] N/A
[Solution] Extract transport class from connection class
[Verification] Build, install, run tests, run server
Change-Id: I165089d861a40e94f13bba31d61bce3b7571ff4e
Lukasz Pawelczyk [Fri, 25 Apr 2014 14:02:55 +0000 (16:02 +0200)]
Delay sending container to the background.
[Bug/Feature] Waiting for a dbus connection could take a long time.
[Cause] The container was CPU throttled immediately after its
start, this made it boot very slowly.
[Solution] Throttle the container after the dbus connection is made.
[Verification] Built, installed and run tests.
Change-Id: I9d69981bfd14820f71f1053a498b37b47a5bcfb1
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Pawelczyk [Thu, 24 Apr 2014 09:15:07 +0000 (11:15 +0200)]
Make rpm also package directories with their proper permissions.
[Bug/Feature] The directories installed by the package were not owned
by the package and there was no control over their
permissions
[Cause] The permissions might have been umask dependent
[Solution] Add the directories to the RPM package, also move the
test config files to the /usr/share
[Verification] Built, installed and checked ownership
with rpm -ql and rpm -qf
Change-Id: I1f124f081aafca6f5971b01e980fb7d510dd634d
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Pawelczyk [Thu, 24 Apr 2014 08:46:35 +0000 (10:46 +0200)]
Cleanup container/domain nomenclature.
[Bug/Feature] Be consistent in using the names container and domain.
[Cause] It wasn't consistent
[Solution] Domain is used for a libvirt, LXC up to a libvirt is called
domain, above that, in our nomenclature it's called container.
[Verification] Built, installed and run tests.
Change-Id: I43dfe58d9cce1b87509b6e36e25e5454abe52d76
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Tue, 15 Apr 2014 15:55:11 +0000 (17:55 +0200)]
Introduce ContainerConnection class
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run server, run tests
Change-Id: I17c1a0ad0186568f94a6d867bb2d81a249aae42a
Mateusz Malicki [Tue, 22 Apr 2014 12:54:43 +0000 (14:54 +0200)]
Properly aligned log when '\n' is used
[Bug/Feature] Multiline logs in SC
[Cause] Wrong aligned logs when '\n' is used
[Solution] N/A
[Verification] Build with --define 'build_type DEBUG' and
run 'security-containers-server -l TRACE' on the target
Change-Id: I260ed215b9dc9a428973b25ac89c0b0176f8b7c4
Lukasz Pawelczyk [Fri, 18 Apr 2014 14:24:48 +0000 (16:24 +0200)]
Make the containers redefine automatically.
[Bug/Feature] Make the containers redefine automatically.
[Cause] It was not convenient to redo tests if they crashed or
were interrupted. Same with the server.
[Solution] Add UUID to the libvirt containers configuration that
makes libvirt redefine them automatically.
[Verification] Built, installed and run tests.
Change-Id: Iac109597878419b8dd611d4402a8f7d751c14f94
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Dariusz Michaluk [Wed, 16 Apr 2014 09:17:23 +0000 (11:17 +0200)]
Various changes in logger
[Bug/Feature] Logger class refactoring
Separate helper functions
Add coloring to the StderrBackend
[Cause] N/A
[Solution] N/A
[Verification] Build with --define "build_type DEBUG" gbs option
Build with --define "build_type RELEASE" gbs option
Install, run tests, check logs in output
Change-Id: Iffca4d7b9edd7640290535605d29140555349876
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
Dariusz Michaluk [Tue, 8 Apr 2014 12:23:19 +0000 (14:23 +0200)]
Various changes in logger
[Bug/Feature] Add systemd journal backend
Add time and function field in stderr backend
Set stderr backend in DEBUG build
Set journal backend in RELEASE build
[Cause] N/A
[Solution] N/A
[Verification] Build with --define "build_type DEBUG" gbs option
Build with --define "build_type RELEASE" gbs option
Install, run tests, check logs in output
Change-Id: I3a4d4b3280a201684ac87c4421bfb2a2596fc72b
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
Pawel Broda [Mon, 14 Apr 2014 07:59:38 +0000 (09:59 +0200)]
More informative logs in Container Admin
[Bug/Feature] Add more logs in Container Admin.
Reformat Container Admin logs.
[Cause] N/A
[Solution] N/A
[Verification] Build and run on the target.
Change-Id: If16acd778a3feba761a349951ca7dc97b89b9309
Piotr Bartosiewicz [Tue, 15 Apr 2014 09:57:53 +0000 (11:57 +0200)]
Fix LOG(message)
[Bug/Feature] Could not log variables with name 'message'.
[Cause] This name is used by variable in LOG macro.
[Solution] Uglify name used in macro.
[Verification] Build, install, run tests.
Change-Id: I0364286f273a5037c9684d935c3ad18d5bb15f69
Michal Witanowski [Tue, 8 Apr 2014 10:58:50 +0000 (12:58 +0200)]
Add DLOG devices to libvirt configurations
[Bug/Feature] DLOG did not work in a container.
[Cause] log_* devices not mounted.
[Solution] Mount needed devices.
[Verification] Redefine, start and log into private/business container.
Check if 'dlogutil' works.
This is only a temporary change, to make logging inside a container
possible at all. In the future, dlog will probably disappear, so this change
will no longer be needed.
Change-Id: Ie2db73a5912b55253e1de8ad353c717816f68908
Piotr Bartosiewicz [Fri, 11 Apr 2014 08:58:47 +0000 (10:58 +0200)]
Fix glib callbacks lifecycle problems
[Bug/Feature] Dbus connection callbacks was called on destroyed
connection.
[Cause] Closing glib connection does not remove pending events
so they can be fired in glib loop thread later.
[Solution] Wait for all callbacks to be deleted before connection
destructor ends.
[Verification] Build, install, run tests.
Change-Id: Id8e1999cf5938be64493cac503fbae1015abc02e
Jan Olszak [Fri, 11 Apr 2014 13:08:21 +0000 (15:08 +0200)]
Operator of conversion to bool for LibvirtDomain and LibvirtConnection
[Bug/Feature] Easy check if the connection is not NULL.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I261d0a8485f2e2bb7f2260b24c95efb139433f7b
Piotr Bartosiewicz [Wed, 9 Apr 2014 13:19:19 +0000 (15:19 +0200)]
Unit tests various fixes
[Bug/Feature] N/A
[Cause] 1) Throwing exception from thread cause unit tests
termination.
2) Dbus daemon can leave its socket after termination.
3) Lambda had access to freed variables.
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I3e1959098cb7c53498f44b862fcb812daf88ada2
Lukasz Pawelczyk [Tue, 8 Apr 2014 15:12:42 +0000 (17:12 +0200)]
Capture the libvirt logs and output them using our log system
[Bug/Feature] Capture the libvirt logs and output them using our log system
[Cause] Libvirt logs were sent to stdout effectively limiting our
internal logging system to capture and store them.
[Solution] Turn off libvirt stdout error reporting (warnings left for now)
and capture messages using libvirt's getLastError().
[Verification] Build, install, run tests on host.
Change-Id: I7bff428ea605697f5d63842ee7175492fb62f579
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Fri, 4 Apr 2014 15:00:40 +0000 (17:00 +0200)]
Support dbus signals
[Bug/Feature] Dbus signal emmiting and handling was not implemented.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests.
Change-Id: If50e544e771ac4d3b4c7034bd13bb7edaba1b65c
Lukasz Pawelczyk [Thu, 3 Apr 2014 11:53:20 +0000 (13:53 +0200)]
Wrap virDomainPtr and virConnectionPtr in classes.
[Bug/Feature] Memleaks detected by valgrind.
[Cause] Container* classes can throw in Contstructors effectively
leaving vir* pointers not cleaned up.
[Solution] Wrap vir* pointers in classes with proper destructors.
[Verification] Build, install, run tests on host, some tests with valgrind.
Change-Id: I2b027c3c57e4105c3909ecac57157043663ffe7e
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Kostyra [Mon, 7 Apr 2014 11:27:09 +0000 (13:27 +0200)]
Update some missing boilerplates
[Bug/Feature] N/A
[Cause] Some boilerplates were skipped by accident when updating.
[Solution] Update skipped boilerplates.
[Verification] N/A
Change-Id: Ia1ef987be8bf610b90e588bc7ee87475d258fb1c
Dariusz Michaluk [Fri, 4 Apr 2014 14:57:12 +0000 (16:57 +0200)]
Modify log format
Change-Id: I544343eb2f8878df432b08ad1427014681bd30b6
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
Lukasz Kostyra [Mon, 7 Apr 2014 10:58:10 +0000 (12:58 +0200)]
Update informations in boilerplates
[Bug/Feature] N/A
[Cause] Informations in boilerplates were outdated.
[Solution] Update year and change contact information to author.
[Verification] N/A
Change-Id: I83a8ecc34d313e06f1e14805b93250eced029e01
Jan Olszak [Tue, 1 Apr 2014 14:08:31 +0000 (16:08 +0200)]
Basic version of the Server class
[Bug/Feature] Server class for managing the life cycle of the server.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests, run security-containers-server
Change-Id: I46fe53bffe9ce7d588bd9cacfefb28af475d048b
Piotr Bartosiewicz [Thu, 3 Apr 2014 10:50:23 +0000 (12:50 +0200)]
Fix container-admin unit tests
[Bug/Feature] ContainerAdminSuite/SuspendTest was failing.
[Cause] virDomainCreate does not wait until container is started.
[Solution] Add sleep in this tests.
[Verification] Build, install, run tests.
Change-Id: Id99388b3d6b10c8a92d46f6b48e7c897c13b29d4
Pawel Broda [Wed, 2 Apr 2014 13:27:22 +0000 (15:27 +0200)]
Remove some 'Requires' dependencies from .spec file
[Bug/Feature] Remove some 'Requires' dependencies, which are
added automatically during rpm build process.
[Cause] N/A
[Solution] N/A
[Verification] Build and run on the target.
Change-Id: I19b3aed771297759f7bb45bd5ab9525fa0d02bb9
Piotr Bartosiewicz [Wed, 2 Apr 2014 08:33:45 +0000 (10:33 +0200)]
Fix logging after last refactor
[Bug/Feature] Logging does not work in unit tests; Files names in log
messages are ambiguous.
[Cause] N/A
[Solution] Fix logging initialization in unit tests.
Use paths related to project root in logs.
Also fix some unrelated includes.
[Verification] Build, install, run tests, check logs in tests output.
Change-Id: Ib5b3f6c91c10f92655a6792171a8810192f99707
Piotr Bartosiewicz [Tue, 1 Apr 2014 14:25:43 +0000 (16:25 +0200)]
Proper fix of debug build issue
[Bug/Feature] Previous fix for build in debug mode issue was
unnecessarily too complicated.
[Cause] N/A
[Solution] N/A
[Verification] Build with --define "build_type DEBUG" gbs option
Change-Id: I83da147dc67ff62d851f14d7acc06b067fd0b15e
Lukasz Pawelczyk [Mon, 31 Mar 2014 17:25:03 +0000 (19:25 +0200)]
Refactor of Security Containers project structure
[Bug/Feature] Complete refactoring of directory structure
[Cause] The old structure was hard to mantain in terms
of keeping filenames and namespaces consistent
and nicely ordered.
[Solution] Made the structure more organized and flat,
refactored several filenames and their namespaces.
- "common" - holds all the common modules and
parts of the code that can be resued between
different targets
- "client" - client target
- "server" - server target
- "unit_tests" - target gathering all unit tests
and their dependencies
[Verification] Built, installed, run tests on host, built RPM, built doc
Change-Id: I728fe2de688f8a0398d7fa348888e5ef7cd77dbf
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Pawelczyk [Fri, 28 Mar 2014 12:39:21 +0000 (13:39 +0100)]
Proper switching focus between containers without freezing background ones
[Bug/Feature] The current focus switching was freezing all
background containers
[Cause] N/A
[Solution] The idea is that a background container should be able to
respond to messages/notifications. It cannot be frozen.
At least not completely (user applications might, system
daemons/services shouldn't). This change starts the
foundations for such operations:
- added functions for settings and getting scheduler
options for CFS scheduler using libvirt API
- some cleanups in ContainerAdmin class
- removal of getAdmin() and new API for the Container class
- new tests for all the new functionalities
- restructurization of config files for unit_tests
(one directory of configs per class)
- removal of "config" in: /etc/security-containers/config/
[Verification] Build, install, run tests on host, build RPM
Change-Id: I2288b71632a6c8043fe47244fa9c0754241cba88
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Piotr Bartosiewicz [Fri, 28 Mar 2014 13:53:09 +0000 (14:53 +0100)]
Dbus exceptions refactor
[Bug/Feature] Pure dbus error handling.
[Cause] N/A
[Solution] Add more exception types, create one base exception for
whole project, make dbus messages more user friendly,
better exception checking in tests.
[Verification] Build, install, run tests
Change-Id: I8d87311f5733bf853179396156fa039e4fd61952
Pawel Broda [Thu, 27 Mar 2014 09:05:52 +0000 (10:05 +0100)]
Add --log-level option
[Feature] Add possibility to run security-containers utilities
with different logging levels (i.e. ERROR, WARN, INFO,
DEBUG, TRACE)
[Cause] N/A
[Solution] N/A
[Verification] Check code with astyle. Build and run on a the target.
Run test suite.
Change-Id: I18f60ba58fed37e69e2bcfccd47046b0ad189e75
Piotr Bartosiewicz [Wed, 26 Mar 2014 12:15:19 +0000 (13:15 +0100)]
Source files names and namespace refactor
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build
Change-Id: I9671af38d57b9ae03bce55a309c8e8cbda6c2d2f
Piotr Bartosiewicz [Wed, 5 Mar 2014 09:54:53 +0000 (10:54 +0100)]
Dbus support
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: Ide6cc4ce714d4554fd165978f29a1af648df9457
Piotr Bartosiewicz [Thu, 20 Mar 2014 14:57:44 +0000 (15:57 +0100)]
CMakeLists cleanup, spec fixes
[Bug/Feature] CMakeLists are ugly
[Cause] N/A
[Solution] Remove obscuring cmake messages,
simplify manual building.
[Verification] Build, install, run tests
Change-Id: I509005a156f808dea10b941cfd24301e98b19e90
Lukasz Pawelczyk [Thu, 20 Mar 2014 12:49:34 +0000 (13:49 +0100)]
Cleanup of Container's architecture, new handling of IDs and config files.
[Bug/Feature] Cleanup of Container's architecture.
[Cause] Container class needs to be extended in future and it's
better it'd be kept modular.
[Solution] - Container class renamed to ContainerAdmin.
- New Container class created that composites ContainerAdmin
and ContainerConfig.
- Cleanup with how IDs are handled. There is no duplication now.
All the config files hold paths to further config files
(manager -> container -> container-admin/libvirt).
- ID is kept only in the libvirt config and is fetched after
the container has been defined.
- Config file paths in configs can be absolute or relative
to the config they are in.
- Properly handle missing config file for ContainerAdmin.
- Improved tests for ContainerManager and ContainerAdmin
(missing and buggy configs).
- Some initial tests for the new Container class.
- dirName method in tools and tests for it.
[Verification] Built and successfully run the unit tests on host + astyle.
Change-Id: I963e5a422a58e68c65052bc61fd1bb5191f9ef4c
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Lukasz Kostyra [Thu, 20 Mar 2014 09:10:41 +0000 (10:10 +0100)]
Install scripts using CMakeLists. Correct script names.
[Issue#] N/A
[Bug] N/A
[Cause] Colorizing scripts were installed using .spec file.
Script names were not conveniently named
[Solution] Install scripts using CMake commands.
Rename scripts.
[Verification] Build, install, run sc_all_tests.py. Result shouldn't change.
Change-Id: Ie6926dbe76a0346f557ddbf6274ca13fa1ae9039
Lukasz Pawelczyk [Tue, 18 Mar 2014 16:59:59 +0000 (17:59 +0100)]
Renamed the *-container.* files (Container class) to *-container-admin.*
[Issue#] PSDAC-215
[Bug] N/A
[Cause] Initial commit for PSDAC-215. Just wanted to handle the renames first.
[Solution] N/A
[Verification] Built and successfully run the unit tests on host.
Change-Id: I8ed156ca13610d785e7828ec445208448b82d4a7
Jan Olszak [Tue, 18 Mar 2014 10:40:44 +0000 (11:40 +0100)]
Astyle code formatting
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] run astyle --options=./astylerc --recursive ./*.cpp ./*.hpp
all files unchanged
Change-Id: I5e0474568d623fcb70c2f8fb7a05ad948c73187d
Mateusz Malicki [Mon, 10 Mar 2014 09:53:16 +0000 (10:53 +0100)]
Added generate_documentation.sh script
[Issue#] N/A
[Feature] Script that generate documentation
[Cause] Documentation management requires too much attention
[Solution] Added generate_documentation.sh script
[Verification] Execute generate_documentation.sh and check if
documenatation was generated
Change-Id: Ia9c1cde6d05712ca66efaade31f38679d258451c
Lukasz Kostyra [Fri, 14 Mar 2014 10:47:49 +0000 (11:47 +0100)]
Add improvements to colorizing script
[Issue#] N/A
[Feature] Adds following features to script colorizing test output:
* sc_tests_all now passes arguments to launched binaries.
* sc_test_launch now allows for absolute path to test binary.
* If any test case fails, script provides a command to launch any test case
explicitly.
* Minor corrections in test result display.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run:
* sc_tests_all - all tests should show up,
* sc_tests_all -t ContainerSuite - only ContainerSuite test suite should show,
* sc_test_launch /bin/security-containers-server-unit-tests - should launch
security-containers-server-unit-tests.
Change-Id: Ic01d8ced2caceb1ed9347ed86fd7417e375bc271
Jan Olszak [Fri, 7 Mar 2014 16:55:52 +0000 (17:55 +0100)]
Introduced the Container Manager
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install, run unit tests.
Change-Id: I8477a67bcb424788e5892e759f057b630c2da3fe
Lukasz Kostyra [Wed, 5 Mar 2014 09:23:01 +0000 (10:23 +0100)]
Add script creating colorful test output
[Issue#] PSDAC-170
[Feature] Adds a script which parses XML test result into a pretty colorful page.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run sc_tests_all. First, Boost output should show up and it should
be colored according to following scheme:
* BOLD RED = line begins with tag [ERROR]
* BOLD YELLOW = line begins with tag [WARN ]
* BOLD BLUE = line begins with tag [INFO ]
* GREEN = line begins with tag [DEBUG]
* BLACK = line begins with tag [TRACE]
Then, a summary containing all test results should show up.
Additionally user can launch Valgrind and GDB using this script. Before entering
binary with test add --valgrind, or --gdb option. Parsing arguments to test binary
works as well.
Example use with Valgrind:
sc_test_launch --valgrind --leak-check=full -v security-containers-server-unit-tests
Change-Id: Ie183ae0ab799e896b7077f979c12c99416d54a84
Pawel Broda [Wed, 12 Mar 2014 17:38:24 +0000 (18:38 +0100)]
Use boost to parse command line options
[Issue#] PSDAC-167
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build and run on a target.
Change-Id: If39fd3966d79e6c92eed55b3df554e05b2ccbdd0
Piotr Bartosiewicz [Wed, 12 Mar 2014 15:38:26 +0000 (16:38 +0100)]
Enable building in debug mode
[Issue#] N/A
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build (with and without --define "build_type DEBUG" gbs
option), install, run tests
Change-Id: Ic25c5091c184c8263c6ae4eb675d467efbe0844d
Piotr Bartosiewicz [Wed, 12 Mar 2014 12:58:54 +0000 (13:58 +0100)]
Small fixes and enhancements
[Issue#] N/A
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: Ibfdfc5a15826e53af0cf734054837121a1539121
Piotr Bartosiewicz [Tue, 11 Mar 2014 10:30:47 +0000 (11:30 +0100)]
More log levels
[Issue#] N/A
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests, see output
Change-Id: Icc89e8ad6cc6e191c6266524056269befdd1a968
Jan Olszak [Wed, 5 Mar 2014 09:10:06 +0000 (10:10 +0100)]
Suspending and resuming domains
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install, run unit tests.
Change-Id: I6c36ca802835e7e05c21817ef030e73e6e5d4e8d
Pawel Broda [Tue, 4 Mar 2014 09:11:44 +0000 (10:11 +0100)]
Add .xml configuration files describing containers
[Issue#] N/A
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build and install on the host
Change-Id: I5e4fcbf8f97b1496c3e11c2c6b0c3bc9ff32d830
Signed-off-by: Pawel Broda <p.broda@partner.samsung.com>
Mateusz Malicki [Thu, 6 Mar 2014 10:38:37 +0000 (11:38 +0100)]
Doxygen for Security Containers
[Issue#] PSDAC-174
[Feature] Doxygen for Security Containers
[Cause] No code documentation
[Solution] Create a configuration file to generate documentation
[Verification] Create documentation by following a procedure described in README file
Change-Id: I9dd8bc5f4ada1cfb6d1b1d844ae892faf8d23fb1
Michal Witanowski [Mon, 24 Feb 2014 09:27:58 +0000 (10:27 +0100)]
Configuration file parsing
[Issue#] PSDAC-147
[Bug/Feature] Parsing/writing configuration files for containers daemon.
[Cause] N/A
[Solution] GenericConfigClass was created.
[Verification] Build, install and run config tests suite via executing
"security-containers-server-unit-tests --run_test=ConfigSuite".
Input and output strings should match (except whitespaces and
floating point values).
Change-Id: I1bf6ceb9dd5c8e4606838a8e758a564da35569c7
Jan Olszak [Thu, 27 Feb 2014 16:26:42 +0000 (17:26 +0100)]
Unit test framework for the daemon
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install,
run security-containers-server-unit-tests
Change-Id: I83404c4c6042a28c7d97ecd20f2c6b41a6041513
Jan Olszak [Thu, 20 Feb 2014 10:24:33 +0000 (11:24 +0100)]
Class for managing libvirt containers
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install,
su; libvirtd
su; security-containers-server
Change-Id: I9ecd109cef8312fad0a006080c73b15032b5ff2e
Jan Olszak [Fri, 14 Feb 2014 13:51:22 +0000 (14:51 +0100)]
Base classes for exceptions.
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install all packages with rpm.
Change-Id: Ieab52a7fc102d191776a4087cb21aca02351871f
Jan Olszak [Fri, 14 Feb 2014 11:42:22 +0000 (12:42 +0100)]
Parsing options in SCS binary.
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install all packages with rpm.
run: security-containers-server -h
run: security-containers-server -v
Change-Id: I9a1e10578968437495209dc5b858af839f822827
Jan Olszak [Tue, 11 Feb 2014 12:52:12 +0000 (13:52 +0100)]
Building and packaging structure.
[Issue#] PSDAC-64
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verfication] Build and install all packages with rpm.
Change-Id: I41654c8aa0e98e8ad3235bb6ec9c257bcad7a3de
Sehong Na [Wed, 26 Mar 2014 07:16:47 +0000 (00:16 -0700)]
Initial empty repository