Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[cli] unit option is csv list
Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
  • Loading branch information
Denis Zalevskiy committed Sep 17, 2014
1 parent 85e8924 commit 607143a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vault.cpp
Expand Up @@ -139,7 +139,7 @@ void Vault::execute(const QVariantMap &options)

Vault vault(options.value("vault").toString());
QStringList units;
for (const QVariant &v: options.value("unit").toList()) {
for (const QVariant &v: options.value("unit").toString().split(",")) {
units << v.toString();
}

Expand Down
20 changes: 19 additions & 1 deletion tests/vault.cpp
Expand Up @@ -36,7 +36,8 @@ enum test_ids {
tid_config_local,
tid_config_update,
tid_simple_blobs,
tid_clear
tid_clear,
tid_cli_backup_restore_several_units
};

namespace {
Expand Down Expand Up @@ -285,4 +286,21 @@ void object::test<tid_clear>()
on_exit();
}


template<> template<>
void object::test<tid_cli_backup_restore_several_units>()
{
auto on_exit = setup();
os::rmtree(home);
os::mkdir(home);
vault_init();
register_unit("unit1", false);
register_unit("unit2", false);
vault::Vault::execute({{"action", "export"}
, {"vault", vault_dir}
, {"home", home}
, {"unit", "unit1,unit2"}});
on_exit();
}

}

0 comments on commit 607143a

Please sign in to comment.