mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-15 06:37:40 +00:00
This patch adds a unit test for `namespace.rs`. The baseline for this test comes from the Go agent tests in which the namespace is mounted in a temporary folder. In order to enable testing in the temporary folder the code was refactored allow configuration for the specified namespace, thus the changes done are described below: - The `setup_persistent_ns` method was moved inside the `Namespace` type. - A builder pattern was implemented for the `Namespace` type. This allows the caller to set the type of the desired namespace as well as the root folder which will help the testing. - A new `NamespaceType` enum was introduced to represent the namespace type. - The user of the `Namespace` type (sandbox.rs) was updated accordingly. Fixes: #50 Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>