[lxc-devel] [lxd/master] Backup: Projects
tomponline on Github
lxc-bot at linuxcontainers.org
Mon Sep 28 10:55:43 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200928/3f7eb783/attachment.bin>
-------------- next part --------------
From 53a8ea5f06709038f9429743f25d56b8cca58a43 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Mon, 28 Sep 2020 11:52:48 +0100
Subject: [PATCH 1/2] suites/backup: Use project argument in
test_backup_volume_export_with_project
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
test/suites/backup.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/test/suites/backup.sh b/test/suites/backup.sh
index 7d866d2672..d45262e702 100644
--- a/test/suites/backup.sh
+++ b/test/suites/backup.sh
@@ -424,10 +424,10 @@ test_backup_volume_export_with_project() {
if [ "$#" -ne 0 ]; then
# Create a project.
- lxc project create foo
- lxc project switch foo
+ lxc project create "$1"
+ lxc project switch "$1"
- deps/import-busybox --project foo --alias testimage
+ deps/import-busybox --project "$1" --alias testimage
# Add a root device to the default profile of the project.
lxc profile device add default root disk path="/" pool="${pool}"
@@ -530,7 +530,9 @@ test_backup_volume_export_with_project() {
rmdir "${LXD_DIR}/non-optimized"
if [ "$#" -ne 0 ]; then
- lxc project switch default
+ lxc image rm testimage
+ lxc project switch default
+ lxc project delete "$1"
fi
}
From 843eaca2f0e486c9884058857ab1424a07839bb1 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Mon, 28 Sep 2020 11:54:17 +0100
Subject: [PATCH 2/2] suites/backup: Use project argument in
test_backup_import_with_project
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
test/suites/backup.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/suites/backup.sh b/test/suites/backup.sh
index d45262e702..43236695bc 100644
--- a/test/suites/backup.sh
+++ b/test/suites/backup.sh
@@ -157,16 +157,16 @@ test_container_import() {
test_backup_import() {
test_backup_import_with_project
- test_backup_import_with_project foo
+ test_backup_import_with_project fooproject
}
test_backup_import_with_project() {
if [ "$#" -ne 0 ]; then
# Create a project
- lxc project create foo
- lxc project switch foo
+ lxc project create "$1"
+ lxc project switch "$1"
- deps/import-busybox --project foo --alias testimage
+ deps/import-busybox --project "$1" --alias testimage
# Add a root device to the default profile of the project
pool="lxdtest-$(basename "${LXD_DIR}")"
@@ -285,7 +285,7 @@ test_backup_import_with_project() {
if [ "$#" -ne 0 ]; then
lxc image rm testimage
lxc project switch default
- lxc project delete foo
+ lxc project delete "$1"
fi
}
More information about the lxc-devel
mailing list