[lxc-devel] [lxd/master] Fix bad tests hiding return values
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Feb 6 00:07:17 UTC 2019
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/20190205/4ed79b3c/attachment-0001.bin>
-------------- next part --------------
From 9fb654494e94fb9b1117bca1cd79f003bcbce404 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:43 +0100
Subject: [PATCH 01/33] tests: Fix negative tests in backup.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/backup.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/test/suites/backup.sh b/test/suites/backup.sh
index 54483e90d5..1de5c09ff8 100644
--- a/test/suites/backup.sh
+++ b/test/suites/backup.sh
@@ -24,7 +24,7 @@ test_container_import() {
lxc init testimage ctImport
lxc start ctImport
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
kill_lxc "${pid}"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport'"
@@ -37,7 +37,7 @@ test_container_import() {
lxc snapshot ctImport
lxc start ctImport
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
kill_lxc "${pid}"
lxc info ctImport | grep snap0
@@ -50,7 +50,7 @@ test_container_import() {
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
kill_lxc "${pid}"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport'"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
lxc start ctImport
@@ -62,7 +62,7 @@ test_container_import() {
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
kill_lxc "${pid}"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport/snap0'"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
lxc start ctImport
@@ -76,7 +76,7 @@ test_container_import() {
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport'"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport/snap0'"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM storage_volumes WHERE name='ctImport'"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
lxc start ctImport
@@ -111,7 +111,7 @@ test_container_import() {
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport'"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM containers WHERE name='ctImport/snap0'"
lxd sql global "PRAGMA foreign_keys=ON; DELETE FROM storage_volumes WHERE name='ctImport'"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
[ -L "${LXD_DIR}/containers/ctImport" ] && [ -d "${LXD_DIR}/storage-pools/lxdtest-$(basename "${LXD_DIR}")/containers/ctImport" ]
@@ -146,7 +146,7 @@ test_container_import() {
esac
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
kill_lxc "${pid}"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
lxc start ctImport
@@ -178,7 +178,7 @@ test_container_import() {
esac
pid=$(lxc info ctImport | grep ^Pid | awk '{print $2}')
kill_lxc "${pid}"
- ! lxd import ctImport
+ ! lxd import ctImport || false
lxd import ctImport --force
lxc info ctImport | grep snap0
lxc start ctImport
From 54f6f855ff3872124fa4d69bb02e03662b0c3cb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 02/33] tests: Fix negative tests in basic.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/basic.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/suites/basic.sh b/test/suites/basic.sh
index 9d71661b34..961b57442d 100644
--- a/test/suites/basic.sh
+++ b/test/suites/basic.sh
@@ -101,7 +101,7 @@ test_basic_usage() {
lxc list --format json | jq '.[]|select(.name="foo")' | grep '"name": "foo"'
# Test list with --columns and --fast
- ! lxc list --columns=nsp --fast
+ ! lxc list --columns=nsp --fast || false
# Test container rename
lxc move foo bar
@@ -177,12 +177,12 @@ test_basic_usage() {
lxc image delete foo-image2
# Test invalid container names
- ! lxc init testimage -abc
- ! lxc init testimage abc-
- ! lxc init testimage 1234
- ! lxc init testimage 12test
- ! lxc init testimage a_b_c
- ! lxc init testimage aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ ! lxc init testimage -abc || false
+ ! lxc init testimage abc- || false
+ ! lxc init testimage 1234 || false
+ ! lxc init testimage 12test || false
+ ! lxc init testimage a_b_c || false
+ ! lxc init testimage aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || false
# Test snapshot publish
lxc snapshot bar
@@ -482,6 +482,6 @@ test_basic_usage() {
! lxc list | grep -q foo || false
# Test renaming/deletion of the default profile
- ! lxc profile rename default foobar
- ! lxc profile delete default
+ ! lxc profile rename default foobar || false
+ ! lxc profile delete default || false
}
From 589583be1d7a23507a8b5909e00af31a6597c3cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 03/33] tests: Fix negative tests in clustering.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/clustering.sh | 60 +++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/test/suites/clustering.sh b/test/suites/clustering.sh
index 39a86f5c60..44a5158a40 100644
--- a/test/suites/clustering.sh
+++ b/test/suites/clustering.sh
@@ -15,7 +15,7 @@ test_clustering_enable() {
lxc launch testimage c1
# A node name is required.
- ! lxc cluster enable
+ ! lxc cluster enable || false
# Enable clustering.
lxc cluster enable node1
@@ -26,7 +26,7 @@ test_clustering_enable() {
lxc list | grep c1 | grep -q node1
# Clustering can't be enabled on an already clustered instance.
- ! lxc cluster enable node2
+ ! lxc cluster enable node2 || false
# Delete the container
lxc stop c1 --force
@@ -125,7 +125,7 @@ test_clustering_membership() {
LXD_DIR="${LXD_TWO_DIR}" lxc config set cluster.offline_threshold 20
# Trying to delete the preseeded network now fails, because a node is degraded.
- ! LXD_DIR="${LXD_TWO_DIR}" lxc network delete "${bridge}"
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc network delete "${bridge}" || false
# Force the removal of the degraded node.
LXD_DIR="${LXD_TWO_DIR}" lxc cluster remove node3 --force
@@ -145,7 +145,7 @@ test_clustering_membership() {
# Trying to delete a node which is the only one with a copy of
# an image results in an error
LXD_DIR="${LXD_FOUR_DIR}" ensure_import_testimage
- ! LXD_DIR="${LXD_FOUR_DIR}" lxc cluster remove node3
+ ! LXD_DIR="${LXD_FOUR_DIR}" lxc cluster remove node3 || false
LXD_DIR="${LXD_TWO_DIR}" lxc image delete testimage
# The image got deleted from the LXD_DIR tree.
@@ -154,7 +154,7 @@ test_clustering_membership() {
# Remove a node gracefully.
LXD_DIR="${LXD_ONE_DIR}" lxc cluster remove node3
- ! LXD_DIR="${LXD_FOUR_DIR}" lxc cluster list
+ ! LXD_DIR="${LXD_FOUR_DIR}" lxc cluster list || false
LXD_DIR="${LXD_FIVE_DIR}" lxd shutdown
LXD_DIR="${LXD_FOUR_DIR}" lxd shutdown
@@ -223,13 +223,13 @@ test_clustering_containers() {
LXD_DIR="${LXD_ONE_DIR}" lxc list | grep foo | grep -q RUNNING
# Trying to delete a node which has container results in an error
- ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster remove node2
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster remove node2 || false
# Exec a command in the container via node1
LXD_DIR="${LXD_ONE_DIR}" lxc exec foo ls / | grep -q proc
# Pull, push and delete files from the container via node1
- ! LXD_DIR="${LXD_ONE_DIR}" lxc file pull foo/non-existing-file "${TEST_DIR}/non-existing-file"
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc file pull foo/non-existing-file "${TEST_DIR}/non-existing-file" || false
mkdir "${TEST_DIR}/hello-world"
echo "hello world" > "${TEST_DIR}/hello-world/text"
LXD_DIR="${LXD_ONE_DIR}" lxc file push "${TEST_DIR}/hello-world/text" foo/hello-world-text
@@ -242,7 +242,7 @@ test_clustering_containers() {
grep -q "hello world" "${TEST_DIR}/hello-world/text"
rm -r "${TEST_DIR}/hello-world"
LXD_DIR="${LXD_ONE_DIR}" lxc file delete foo/hello-world/text
- ! LXD_DIR="${LXD_ONE_DIR}" lxc file pull foo/hello-world/text "${TEST_DIR}/hello-world-text"
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc file pull foo/hello-world/text "${TEST_DIR}/hello-world-text" || false
# Stop the container via node1
LXD_DIR="${LXD_ONE_DIR}" lxc stop foo --force
@@ -260,7 +260,7 @@ test_clustering_containers() {
LXD_DIR="${LXD_ONE_DIR}" lxc info foo | grep -q foo-bak
LXD_DIR="${LXD_ONE_DIR}" lxc rename foo/foo-bak foo/foo-bak-2
LXD_DIR="${LXD_ONE_DIR}" lxc delete foo/foo-bak-2
- ! LXD_DIR="${LXD_ONE_DIR}" lxc info foo | grep -q foo-bak-2
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc info foo | grep -q foo-bak-2 || false
# Export from node1 the image that was imported on node2
LXD_DIR="${LXD_ONE_DIR}" lxc image export testimage "${TEST_DIR}/testimage"
@@ -271,7 +271,7 @@ test_clustering_containers() {
LXD_DIR="${LXD_TWO_DIR}" lxc launch --target node1 testimage bar
LXD_DIR="${LXD_TWO_DIR}" lxc stop bar --force
LXD_DIR="${LXD_ONE_DIR}" lxc delete bar
- ! LXD_DIR="${LXD_TWO_DIR}" lxc list | grep -q bar
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc list | grep -q bar || false
# Create a container on node1 using a snapshot from node2.
LXD_DIR="${LXD_ONE_DIR}" lxc snapshot foo foo-bak
@@ -378,7 +378,7 @@ test_clustering_storage() {
LXD_DIR="${LXD_ONE_DIR}" lxc storage list | grep data | grep -q CREATED
# Trying to pass config values other than 'source' results in an error
- ! LXD_DIR="${LXD_ONE_DIR}" lxc storage create pool1 dir source=/foo size=123 --target node1
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc storage create pool1 dir source=/foo size=123 --target node1 || false
# Define storage pools on the two nodes
driver_config=""
@@ -406,7 +406,7 @@ test_clustering_storage() {
fi
LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep -q node1
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep -q node2
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep -q node2 || false
if [ -n "${driver_config_node2}" ]; then
# shellcheck disable=SC2086
LXD_DIR="${LXD_ONE_DIR}" lxc storage create pool1 "${driver}" ${driver_config_node2} --target node2
@@ -417,7 +417,7 @@ test_clustering_storage() {
# The source config key is not legal for the final pool creation
if [ "${driver}" = "dir" ]; then
- ! LXD_DIR="${LXD_ONE_DIR}" lxc storage create pool1 dir source=/foo
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc storage create pool1 dir source=/foo || false
fi
# Create the storage pool
@@ -432,7 +432,7 @@ test_clustering_storage() {
# The 'source' config key is omitted when showing the cluster
# configuration, and included when showing the node-specific one.
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep -q source
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep -q source || false
source1="$(basename "${LXD_ONE_DIR}")"
source2="$(basename "${LXD_TWO_DIR}")"
if [ "${driver}" = "ceph" ]; then
@@ -448,7 +448,7 @@ test_clustering_storage() {
LXD_DIR="${LXD_ONE_DIR}" lxc storage set pool1 rsync.bwlimit 10
LXD_DIR="${LXD_TWO_DIR}" lxc storage show pool1 | grep rsync.bwlimit | grep -q 10
LXD_DIR="${LXD_TWO_DIR}" lxc storage unset pool1 rsync.bwlimit
- ! LXD_DIR="${LXD_ONE_DIR}" lxc storage show pool1 | grep -q rsync.bwlimit
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc storage show pool1 | grep -q rsync.bwlimit || false
fi
if [ "${driver}" = "ceph" ]; then
@@ -516,7 +516,7 @@ test_clustering_storage() {
# Trying to attach a custom volume to a container on another node fails
LXD_DIR="${LXD_TWO_DIR}" lxc init --target node2 -s pool1 testimage buz
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume attach pool1 custom/v1 buz testDevice /opt
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume attach pool1 custom/v1 buz testDevice /opt || false
LXD_DIR="${LXD_ONE_DIR}" lxc storage volume detach pool1 v1 baz
@@ -569,7 +569,7 @@ test_clustering_storage() {
# Delete the storage pool
LXD_DIR="${LXD_ONE_DIR}" lxc storage delete pool1
- ! LXD_DIR="${LXD_ONE_DIR}" lxc storage list | grep -q pool1
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc storage list | grep -q pool1 || false
if [ "${driver}" != "ceph" ]; then
# Create a volume on node1
@@ -590,9 +590,9 @@ test_clustering_storage() {
# Trying to show, rename or delete the web volume without --target
# fails, because it's not unique.
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume show data web
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume rename data web webbaz
- ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume delete data web
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume show data web || false
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume rename data web webbaz || false
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc storage volume delete data web || false
# Specifying the --target parameter shows, renames and deletes the
# proper volume.
@@ -655,20 +655,20 @@ test_clustering_network() {
# Trying to pass config values other than
# 'bridge.external_interfaces' results in an error
- ! LXD_DIR="${LXD_ONE_DIR}" lxc network create foo ipv4.address=auto --target node1
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc network create foo ipv4.address=auto --target node1 || false
net="${bridge}x"
# Define networks on the two nodes
LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" --target node1
LXD_DIR="${LXD_TWO_DIR}" lxc network show "${net}" | grep -q node1
- ! LXD_DIR="${LXD_TWO_DIR}" lxc network show "${net}" | grep -q node2
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc network show "${net}" | grep -q node2 || false
LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" --target node2
- ! LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" --target node2
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" --target node2 || false
LXD_DIR="${LXD_ONE_DIR}" lxc network show "${net}" | grep status: | grep -q Pending
# The bridge.external_interfaces config key is not legal for the final network creation
- ! LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" bridge.external_interfaces=foo
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc network create "${net}" bridge.external_interfaces=foo || false
# Create the network
LXD_DIR="${LXD_TWO_DIR}" lxc network create "${net}"
@@ -676,7 +676,7 @@ test_clustering_network() {
LXD_DIR="${LXD_ONE_DIR}" lxc network show "${net}" --target node2 | grep status: | grep -q Created
# FIXME: rename the network is not supported with clustering
- ! LXD_DIR="${LXD_TWO_DIR}" lxc network rename "${net}" "${net}-foo"
+ ! LXD_DIR="${LXD_TWO_DIR}" lxc network rename "${net}" "${net}-foo" || false
# Delete the networks
LXD_DIR="${LXD_TWO_DIR}" lxc network delete "${net}"
@@ -724,7 +724,7 @@ test_clustering_upgrade() {
LXD_NETNS="${ns2}" respawn_lxd "${LXD_TWO_DIR}" false
# The second daemon is blocked waiting for the other to be upgraded
- ! LXD_DIR="${LXD_TWO_DIR}" lxd waitready --timeout=5
+ ! LXD_DIR="${LXD_TWO_DIR}" lxd waitready --timeout=5 || false
LXD_DIR="${LXD_ONE_DIR}" lxc cluster show node1 | grep -q "message: fully operational"
LXD_DIR="${LXD_ONE_DIR}" lxc cluster show node2 | grep -q "message: waiting for other nodes to be upgraded"
@@ -738,7 +738,7 @@ test_clustering_upgrade() {
LXD_DIR="${LXD_TWO_DIR}" lxd waitready --timeout=30
# The cluster is again operational
- ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster list | grep -q "OFFLINE"
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster list | grep -q "OFFLINE" || false
# Now spawn a third node and test the upgrade with a 3-node cluster.
setup_clustering_netns 3
@@ -755,7 +755,7 @@ test_clustering_upgrade() {
# The second daemon is blocked waiting for the other two to be
# upgraded
- ! LXD_DIR="${LXD_TWO_DIR}" lxd waitready --timeout=5
+ ! LXD_DIR="${LXD_TWO_DIR}" lxd waitready --timeout=5 || false
LXD_DIR="${LXD_ONE_DIR}" lxc cluster show node1 | grep -q "message: fully operational"
LXD_DIR="${LXD_ONE_DIR}" lxc cluster show node2 | grep -q "message: waiting for other nodes to be upgraded"
@@ -769,7 +769,7 @@ test_clustering_upgrade() {
LXD_NETNS="${ns3}" respawn_lxd "${LXD_THREE_DIR}" true
# The cluster is again operational
- ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster list | grep -q "OFFLINE"
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc cluster list | grep -q "OFFLINE" || false
LXD_DIR="${LXD_THREE_DIR}" lxd shutdown
LXD_DIR="${LXD_TWO_DIR}" lxd shutdown
@@ -1104,7 +1104,7 @@ test_clustering_address() {
lxc storage list cluster:| grep -q data
# The cluster.https_address config value can't be changed.
- ! LXD_DIR="${LXD_ONE_DIR}" lxc config set "cluster.https_address" "10.1.1.101:8448"
+ ! LXD_DIR="${LXD_ONE_DIR}" lxc config set "cluster.https_address" "10.1.1.101:8448" || false
# Create a container using the REST API exposed over core.https_address.
LXD_DIR="${LXD_ONE_DIR}" deps/import-busybox --alias testimage
From 9aed2baa68125954bface00ab273e377f157e568 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 04/33] tests: Fix negative tests in config.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/config.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/suites/config.sh b/test/suites/config.sh
index 97baa94fc2..faeae6f80d 100644
--- a/test/suites/config.sh
+++ b/test/suites/config.sh
@@ -121,7 +121,7 @@ test_config_profiles() {
# setting an invalid config item should error out when setting it, not get
# into the database and never let the user edit the container again.
- ! lxc config set foo raw.lxc lxc.notaconfigkey=invalid
+ ! lxc config set foo raw.lxc lxc.notaconfigkey=invalid || false
# check that various profile application mechanisms work
lxc profile create one
@@ -203,10 +203,10 @@ test_config_profiles() {
lxc start foo
lxc exec foo -- ls /mnt2/hosts
lxc config device remove foo mnt2
- ! lxc exec foo -- ls /mnt2/hosts
+ ! lxc exec foo -- ls /mnt2/hosts || false
lxc stop foo --force
lxc start foo
- ! lxc exec foo -- ls /mnt2/hosts
+ ! lxc exec foo -- ls /mnt2/hosts || false
lxc stop foo --force
lxc config set foo user.prop value
@@ -214,8 +214,8 @@ test_config_profiles() {
lxc config unset foo user.prop
# Test for invalid raw.lxc
- ! lxc config set foo raw.lxc a
- ! lxc profile set default raw.lxc a
+ ! lxc config set foo raw.lxc a || false
+ ! lxc profile set default raw.lxc a || false
bad=0
lxc list user.prop=value | grep foo && bad=1
From b220cbe5f2273023d3921430ffb37feb1ff3829c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 05/33] tests: Fix negative tests in
container_local_cross_pool_handling.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/container_local_cross_pool_handling.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/suites/container_local_cross_pool_handling.sh b/test/suites/container_local_cross_pool_handling.sh
index 224aa2415e..78a5533429 100644
--- a/test/suites/container_local_cross_pool_handling.sh
+++ b/test/suites/container_local_cross_pool_handling.sh
@@ -61,7 +61,7 @@ test_container_local_cross_pool_handling() {
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1"
- ! lxc list c1
+ ! lxc list c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc delete -f c2
@@ -70,14 +70,14 @@ test_container_local_cross_pool_handling() {
lxc snapshot c1
lxc copy c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1" --container-only
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0 || false
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1 || false
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1" --container-only
- ! lxc list c1
+ ! lxc list c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0 || false
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1 || false
lxc delete -f c2
lxc init testimage c1
@@ -89,7 +89,7 @@ test_container_local_cross_pool_handling() {
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1"
- ! lxc list c1
+ ! lxc list c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
From 09ea184dfcc99f4e8c7f43c6edc86372cd893f4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 06/33] tests: Fix negative tests in database_update.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/database_update.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/suites/database_update.sh b/test/suites/database_update.sh
index 51bea4e247..3a93f23f74 100644
--- a/test/suites/database_update.sh
+++ b/test/suites/database_update.sh
@@ -33,8 +33,8 @@ EOF
LXD_DIR="${LXD_MIGRATE_DIR}" lxd sql global "SELECT * FROM test" | grep -q "1"
# The custom patch files were deleted.
- ! [ -e "${LXD_MIGRATE_DIR}/database/patch.local.sql" ]
- ! [ -e "${LXD_MIGRATE_DIR}/database/patch.global.sql" ]
+ ! [ -e "${LXD_MIGRATE_DIR}/database/patch.local.sql" ] || false
+ ! [ -e "${LXD_MIGRATE_DIR}/database/patch.global.sql" ] || false
kill_lxd "$LXD_MIGRATE_DIR"
}
@@ -62,7 +62,7 @@ INSERT INTO broken(n) VALUES(1);
EOF
# Starting LXD fails.
- ! LXD_DIR="${LXD_RESTORE_DIR}" lxd --logfile "${LXD_RESTORE_DIR}/lxd.log" "${DEBUG-}" 2>&1
+ ! LXD_DIR="${LXD_RESTORE_DIR}" lxd --logfile "${LXD_RESTORE_DIR}/lxd.log" "${DEBUG-}" 2>&1 || false
# Remove the broken patch
rm -f "${LXD_RESTORE_DIR}/database/patch.global.sql"
From ff7bebaa191f60b86ef7f91f45d7c498720c9e1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:47 +0100
Subject: [PATCH 07/33] tests: Fix negative tests in devlxd.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/devlxd.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/suites/devlxd.sh b/test/suites/devlxd.sh
index 9581fcf4de..ae6f890605 100644
--- a/test/suites/devlxd.sh
+++ b/test/suites/devlxd.sh
@@ -9,7 +9,7 @@ test_devlxd() {
lxc launch testimage devlxd -c security.devlxd=false
- ! lxc exec devlxd -- test -S /dev/lxd/sock
+ ! lxc exec devlxd -- test -S /dev/lxd/sock || false
lxc config unset devlxd security.devlxd
lxc exec devlxd -- test -S /dev/lxd/sock
lxc file push "${TEST_DIR}/devlxd-client" devlxd/bin/
@@ -20,7 +20,7 @@ test_devlxd() {
lxc exec devlxd devlxd-client user.foo | grep bar
lxc config set devlxd security.nesting true
- ! lxc exec devlxd devlxd-client security.nesting | grep true
+ ! lxc exec devlxd devlxd-client security.nesting | grep true || false
lxc exec devlxd devlxd-client monitor > "${TEST_DIR}/devlxd.log" &
client=$!
From 519d95333a93c207df7ba886275288be5ace4920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 08/33] tests: Fix negative tests in external_auth.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/external_auth.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/suites/external_auth.sh b/test/suites/external_auth.sh
index 2b8163cf14..a929ef84ba 100644
--- a/test/suites/external_auth.sh
+++ b/test/suites/external_auth.sh
@@ -12,7 +12,7 @@ test_macaroon_auth() {
# invalid credentials make the remote add fail
# shellcheck disable=SC2039
- ! cat <<EOF | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate
+ ! cat || false <<EOF | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate
wrong-user
wrong-pass
EOF
From 74e4725b15743afd9001c9e3c827e8de8e32f9a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 09/33] tests: Fix negative tests in idmap.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/idmap.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/suites/idmap.sh b/test/suites/idmap.sh
index 6be8683bbd..2d8be7d8f9 100644
--- a/test/suites/idmap.sh
+++ b/test/suites/idmap.sh
@@ -108,7 +108,7 @@ test_idmap() {
# Validate non-overlapping maps
lxc exec idmap -- touch /a
- ! lxc exec idmap -- chown 65536 /a
+ ! lxc exec idmap -- chown 65536 /a || false
lxc exec idmap -- chown 65535 /a
PID_1=$(lxc info idmap | grep ^Pid | awk '{print $2}')
UID_1=$(stat -c '%u' "/proc/${PID_1}/root/a")
@@ -182,7 +182,7 @@ test_idmap() {
lxc delete idmap1 idmap2 idmap3 --force
# Test running out of ids
- ! lxc launch testimage idmap1 -c security.idmap.isolated=true -c security.idmap.size=$((UIDs+1))
+ ! lxc launch testimage idmap1 -c security.idmap.isolated=true -c security.idmap.size=$((UIDs+1)) || false
# Test raw id maps
(
From d5cdf2755845f9266cb9d2870a7e2e72610044bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 10/33] tests: Fix negative tests in incremental_copy.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/incremental_copy.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/suites/incremental_copy.sh b/test/suites/incremental_copy.sh
index d3e579c429..27348e5a30 100644
--- a/test/suites/incremental_copy.sh
+++ b/test/suites/incremental_copy.sh
@@ -44,14 +44,14 @@ do_copy() {
lxc copy c1 c2 ${pool}
# Make sure the testfile doesn't exist
- ! lxc exec c1 -- touch /root/testfile1
- ! lxc exec c2 -- touch /root/testfile1
+ ! lxc exec c1 -- touch /root/testfile1 || false
+ ! lxc exec c2 -- touch /root/testfile1 || false
lxc start c1 c2
# Target container may not be running when refreshing
# shellcheck disable=2086
- ! lxc copy c1 c2 --refresh ${pool}
+ ! lxc copy c1 c2 --refresh ${pool} || false
# Create test file in c1
lxc exec c1 -- touch /root/testfile1
@@ -73,11 +73,11 @@ do_copy() {
# shellcheck disable=2086
lxc copy c1 c2 --refresh --container-only ${pool}
lxc start c2
- ! lxc exec c2 -- test -f /root/testfile1
+ ! lxc exec c2 -- test -f /root/testfile1 || false
lxc stop -f c2
# Check whether snapshot c2/snap0 has been created
- ! lxc config show c2/snap0
+ ! lxc config show c2/snap0 || false
# shellcheck disable=2086
lxc copy c1 c2 --refresh ${pool}
lxc config show c2/snap0
@@ -89,7 +89,7 @@ do_copy() {
# This should remove c2/snap1
# shellcheck disable=2086
lxc copy c1 c2 --refresh ${pool}
- ! lxc config show c2/snap1
+ ! lxc config show c2/snap1 || false
lxc rm -f c1 c2
}
From a578f7772b9201e6eb71bfa6aa5168f15a739bdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 11/33] tests: Fix negative tests in lxc-to-lxd.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/lxc-to-lxd.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/suites/lxc-to-lxd.sh b/test/suites/lxc-to-lxd.sh
index 9f5eb0d32e..a0431b6234 100644
--- a/test/suites/lxc-to-lxd.sh
+++ b/test/suites/lxc-to-lxd.sh
@@ -17,9 +17,9 @@ test_lxc_to_lxd() {
[ "$(lxc-ls -P "${LXC_DIR}" -1 | wc -l)" -eq "3" ]
# Ensure no containers have been converted
- ! lxc info c1
- ! lxc info c2
- ! lxc info c3
+ ! lxc info c1 || false
+ ! lxc info c2 || false
+ ! lxc info c3 || false
# Convert single LXC container
lxc-to-lxd --lxcpath "${LXC_DIR}" --containers c1
@@ -29,8 +29,8 @@ test_lxc_to_lxd() {
# Ensure only c1 has been converted
lxc info c1
- ! lxc info c2
- ! lxc info c3
+ ! lxc info c2 || false
+ ! lxc info c3 || false
# Ensure the converted container is startable
lxc start c1
@@ -45,7 +45,7 @@ test_lxc_to_lxd() {
# Ensure all containers have been converted
lxc info c1
lxc info c2
- ! lxc info c3
+ ! lxc info c3 || false
# Convert all LXC containers
lxc-to-lxd --lxcpath "${LXC_DIR}" --delete --all
From 955b29d11746a5b2ad8e1232d784aacd5862e764 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 12/33] tests: Fix negative tests in migration.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/migration.sh | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/test/suites/migration.sh b/test/suites/migration.sh
index ad5e0fc668..b6e9a3c34a 100644
--- a/test/suites/migration.sh
+++ b/test/suites/migration.sh
@@ -176,7 +176,7 @@ migration() {
# Remote container only move.
lxc_remote move l1:cccp l2:udssr --container-only --mode=relay
- ! lxc_remote info l1:cccp
+ ! lxc_remote info l1:cccp || false
[ "$(lxc_remote info l2:udssr | grep -c snap)" -eq 0 ]
lxc_remote delete l2:udssr
@@ -186,7 +186,7 @@ migration() {
# Remote container with snapshots move.
lxc_remote move l1:cccp l2:udssr --mode=push
- ! lxc_remote info l1:cccp
+ ! lxc_remote info l1:cccp || false
[ "$(lxc_remote info l2:udssr | grep -c snap)" -eq 2 ]
lxc_remote delete l2:udssr
@@ -197,7 +197,7 @@ migration() {
# Local container with snapshots move.
lxc move cccp udssr --mode=pull
- ! lxc info cccp
+ ! lxc info cccp || false
[ "$(lxc info udssr | grep -c snap)" -eq 2 ]
lxc delete udssr
@@ -229,13 +229,13 @@ migration() {
lxc_remote start l1:c1 l2:c2
# Make sure the testfile doesn't exist
- ! lxc file pull l1:c1 -- /root/testfile1
- ! lxc file pull l2:c2 -- /root/testfile1
+ ! lxc file pull l1:c1 -- /root/testfile1 || false
+ ! lxc file pull l2:c2 -- /root/testfile1 || false
#lxc_remote start l1:c1 l2:c2
# Containers may not be running when refreshing
- ! lxc_remote copy l1:c1 l2:c2 --refresh
+ ! lxc_remote copy l1:c1 l2:c2 --refresh || false
# Create test file in c1
echo test | lxc_remote file push - l1:c1/root/testfile1
@@ -256,11 +256,11 @@ migration() {
lxc_remote file delete l1:c1/root/testfile1
lxc_remote copy l1:c1 l2:c2 --refresh --container-only
lxc_remote start l2:c2
- ! lxc_remote file pull l2:c2/root/testfile1 .
+ ! lxc_remote file pull l2:c2/root/testfile1 . || false
lxc_remote stop -f l2:c2
# Check whether snapshot c2/snap0 has been created
- ! lxc_remote config show l2:c2/snap0
+ ! lxc_remote config show l2:c2/snap0 || false
lxc_remote copy l1:c1 l2:c2 --refresh
lxc_remote ls l2:
lxc_remote config show l2:c2/snap0
@@ -271,7 +271,7 @@ migration() {
# This should remove c2/snap1
lxc_remote copy l1:c1 l2:c2 --refresh
- ! lxc_remote config show l2:c2/snap1
+ ! lxc_remote config show l2:c2/snap1 || false
lxc_remote rm -f l1:c1 l2:c2
@@ -283,7 +283,7 @@ migration() {
# remote storage volume migration in "pull" mode
lxc_remote storage volume copy l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol2"
lxc_remote storage volume move l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol3"
- ! lxc_remote storage volume list l1:"$remote_pool1/vol1"
+ ! lxc_remote storage volume list l1:"$remote_pool1/vol1" || false
lxc_remote storage volume delete l2:"$remote_pool2" vol2
lxc_remote storage volume delete l2:"$remote_pool2" vol3
@@ -293,7 +293,7 @@ migration() {
lxc_remote storage volume copy l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol2" --mode=push
lxc_remote storage volume move l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol3" --mode=push
- ! lxc_remote storage volume list l1:"$remote_pool1/vol1"
+ ! lxc_remote storage volume list l1:"$remote_pool1/vol1" || false
lxc_remote storage volume delete l2:"$remote_pool2" vol2
lxc_remote storage volume delete l2:"$remote_pool2" vol3
@@ -303,7 +303,7 @@ migration() {
lxc_remote storage volume copy l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol2" --mode=relay
lxc_remote storage volume move l1:"$remote_pool1/vol1" l2:"$remote_pool2/vol3" --mode=relay
- ! lxc_remote storage volume list l1:"$remote_pool1/vol1"
+ ! lxc_remote storage volume list l1:"$remote_pool1/vol1" || false
lxc_remote storage volume delete l2:"$remote_pool2" vol2
lxc_remote storage volume delete l2:"$remote_pool2" vol3
@@ -364,7 +364,7 @@ migration() {
# Test copy of stateful snapshot
lxc_remote copy l2:migratee/snap0 l1:migratee
- ! lxc_remote copy l2:migratee/snap0 l1:migratee-new-name
+ ! lxc_remote copy l2:migratee/snap0 l1:migratee-new-name || false
# Test stateless copies
lxc_remote copy --stateless l2:migratee/snap0 l1:migratee-new-name
From ccfc64f3dd86b0451587cf8bcd9aeaf00846bdd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 13/33] tests: Fix negative tests in pki.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/pki.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/suites/pki.sh b/test/suites/pki.sh
index 26f52e1974..3abc3e160d 100644
--- a/test/suites/pki.sh
+++ b/test/suites/pki.sh
@@ -52,7 +52,7 @@ test_pki() {
)
# Confirm that a normal, non-PKI certificate doesn't
- ! lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password=foo
+ ! lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password=foo || false
kill_lxd "${LXD5_DIR}"
}
From 5577e75a0df25bf748c54115d5d8405ddf98b37f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:48 +0100
Subject: [PATCH 14/33] tests: Fix negative tests in projects.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/projects.sh | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/test/suites/projects.sh b/test/suites/projects.sh
index e56aa37832..241467ee7f 100644
--- a/test/suites/projects.sh
+++ b/test/suites/projects.sh
@@ -21,7 +21,7 @@ test_projects_crud() {
lxc project get foo "features.profiles" | grep -q 'true'
# Trying to create a project with the same name fails
- ! lxc project create foo
+ ! lxc project create foo || false
# Rename the project
lxc project rename foo bar
@@ -34,7 +34,7 @@ test_projects_crud() {
lxc project create foo
# Trying to rename a project using an existing name fails
- ! lxc project rename bar foo
+ ! lxc project rename bar foo || false
lxc project switch foo
@@ -95,17 +95,17 @@ test_projects_containers() {
# The container can't be managed when using the default project
lxc project switch default
- ! lxc list | grep -q c1
- ! lxc info c1
- ! lxc delete c1
- ! lxc storage volume list "${pool}" | grep -q c1
+ ! lxc list | grep -q c1 || false
+ ! lxc info c1 || false
+ ! lxc delete c1 || false
+ ! lxc storage volume list "${pool}" | grep -q c1 || false
# Trying to delete a project which is in use fails
- ! lxc project delete foo
+ ! lxc project delete foo || false
# Trying to change features of a project which is in use fails
- ! lxc project show foo| sed 's/features.profiles:.*/features.profiles: "false"/' | lxc project edit foo
- ! lxc project set foo "features.profiles" "false"
+ ! lxc project show foo| sed 's/features.profiles:.*/features.profiles: "false"/' | lxc project edit foo || false
+ ! lxc project set foo "features.profiles" "false" || false
lxc project show foo | grep -q 'features.profiles: "true"'
# Create a container with the same name in the default project
@@ -272,7 +272,7 @@ test_projects_profiles() {
# The profile is not visible in the default project
lxc project switch default
- ! lxc profile list | grep -q 'p1'
+ ! lxc profile list | grep -q 'p1' || false
# A profile with the same name can be created in the default project
lxc profile create p1
@@ -344,7 +344,7 @@ test_projects_images() {
# The imported image is not visible in the default project.
lxc project switch default
- ! lxc image list | grep -q "${fingerprint}"
+ ! lxc image list | grep -q "${fingerprint}" || false
# Switch back to the project and clean it up.
lxc project switch foo
@@ -358,7 +358,7 @@ test_projects_images() {
# However the image alias is not visible in the default project.
lxc project switch default
- ! lxc image list | grep -q foo-project
+ ! lxc image list | grep -q foo-project || false
# Let's import the same image in the default project
ensure_import_testimage
@@ -367,7 +367,7 @@ test_projects_images() {
lxc project switch foo
# The image alias from the default project is not visiable here
- ! lxc image list | grep -q testimage
+ ! lxc image list | grep -q testimage || false
# Rename the image alias in the project using the same it has in the default
# one.
@@ -429,7 +429,7 @@ test_projects_storage() {
lxc project switch default
- ! lxc storage volume list "${pool}" | grep -q custom
+ ! lxc storage volume list "${pool}" | grep -q custom || false
lxc project delete foo
}
From b1338a4988f339c60af6f9cb0d73fe6b6f5d0d2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 15/33] tests: Fix negative tests in remote.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/remote.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/suites/remote.sh b/test/suites/remote.sh
index e20f10bf1b..f8c713ae04 100644
--- a/test/suites/remote.sh
+++ b/test/suites/remote.sh
@@ -16,7 +16,7 @@ test_remote_url() {
fi
# an invalid protocol returns an error
- ! lxc_remote remote add test "${url}" --accept-certificate --password foo --protocol foo
+ ! lxc_remote remote add test "${url}" --accept-certificate --password foo --protocol foo || false
for url in ${urls}; do
lxc_remote remote add test "${url}"
@@ -26,7 +26,7 @@ test_remote_url() {
test_remote_admin() {
lxc_remote remote add badpass "${LXD_ADDR}" --accept-certificate --password bad || true
- ! lxc_remote list badpass:
+ ! lxc_remote list badpass: || false
lxc_remote remote add localhost "${LXD_ADDR}" --accept-certificate --password foo
lxc_remote remote list | grep 'localhost'
@@ -39,7 +39,7 @@ test_remote_admin() {
lxc_remote remote list | grep -v 'localhost'
[ "$(lxc_remote remote get-default)" = "foo" ]
- ! lxc_remote remote remove foo
+ ! lxc_remote remote remove foo || false
lxc_remote remote set-default local
lxc_remote remote remove foo
@@ -118,7 +118,7 @@ test_remote_usage() {
lxc_remote publish pub lxd2: --alias bar --public a=b
lxc_remote image show lxd2:bar | grep -q "a: b"
lxc_remote image show lxd2:bar | grep -q "public: true"
- ! lxc_remote image show bar
+ ! lxc_remote image show bar || false
lxc_remote delete pub
# test spawn from public server
From c0ba1d7234ff0c267b0b4f4284050be77fcb5be3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 16/33] tests: Fix negative tests in security.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/security.sh | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/test/suites/security.sh b/test/suites/security.sh
index 9a1459e9cd..147bc07673 100644
--- a/test/suites/security.sh
+++ b/test/suites/security.sh
@@ -74,16 +74,16 @@ test_security() {
ensure_import_testimage
# Verify that no privileged container can be created
- ! lxc launch testimage c1 -c security.privileged=true
+ ! lxc launch testimage c1 -c security.privileged=true || false
# Verify that unprivileged container can be created
lxc launch testimage c1
# Verify that we can't be tricked into using privileged containers
- ! lxc config set c1 security.privileged true
- ! lxc config set c1 raw.idmap "both 1000 1000"
- ! lxc config set c1 raw.lxc "lxc.idmap="
- ! lxc config set c1 raw.lxc "lxc.include="
+ ! lxc config set c1 security.privileged true || false
+ ! lxc config set c1 raw.idmap "both 1000 1000" || false
+ ! lxc config set c1 raw.lxc "lxc.idmap=" || false
+ ! lxc config set c1 raw.lxc "lxc.include=" || false
# Verify that we can still unset and set to security.privileged to "false"
lxc config set c1 security.privileged false
@@ -91,10 +91,10 @@ test_security() {
# Verify that a profile can't be changed to trick us into using privileged
# containers
- ! lxc profile set default security.privileged true
- ! lxc profile set default raw.idmap "both 1000 1000"
- ! lxc profile set default raw.lxc "lxc.idmap="
- ! lxc profile set default raw.lxc "lxc.include="
+ ! lxc profile set default security.privileged true || false
+ ! lxc profile set default raw.idmap "both 1000 1000" || false
+ ! lxc profile set default raw.lxc "lxc.idmap=" || false
+ ! lxc profile set default raw.lxc "lxc.include=" || false
# Verify that we can still unset and set to security.privileged to "false"
lxc profile set default security.privileged false
@@ -122,7 +122,7 @@ test_security_protection() {
lxc init testimage c1
lxc snapshot c1
lxc delete c1/snap0
- ! lxc delete c1
+ ! lxc delete c1 || false
lxc config set c1 security.protection.delete false
lxc delete c1
@@ -138,13 +138,13 @@ test_security_protection() {
lxc start c1
lxc stop c1 --force
- ! lxc publish c1 --alias=protected
+ ! lxc publish c1 --alias=protected || false
lxc snapshot c1
lxc publish c1/snap0 --alias=protected
lxc image delete protected
lxc config set c1 security.privileged true
- ! lxc start c1
+ ! lxc start c1 || false
lxc config set c1 security.protection.shift false
lxc start c1
lxc stop c1 --force
From c5f8e82877cb07c1c08fd8d8188140ba9609d8ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 17/33] tests: Fix negative tests in serverconfig.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/serverconfig.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/suites/serverconfig.sh b/test/suites/serverconfig.sh
index 0b4eaf8dff..e8a16ed2b4 100644
--- a/test/suites/serverconfig.sh
+++ b/test/suites/serverconfig.sh
@@ -18,7 +18,7 @@ test_server_config() {
# test authentication type
curl --unix-socket "$LXD_DIR/unix.socket" "lxd/1.0" | jq .metadata.auth_methods | grep tls
# only tls is enabled by default
- ! curl --unix-socket "$LXD_DIR/unix.socket" "lxd/1.0" | jq .metadata.auth_methods | grep candid
+ ! curl --unix-socket "$LXD_DIR/unix.socket" "lxd/1.0" | jq .metadata.auth_methods | grep candid || false
lxc config set candid.api.url "https://localhost:8081"
# macaroons are also enabled
curl --unix-socket "$LXD_DIR/unix.socket" "lxd/1.0" | jq .metadata.auth_methods | grep candid
From 5ebaba43943c4daf5dde9cc2d34310c9c91ec836 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 18/33] tests: Fix negative tests in snapshots.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/snapshots.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/suites/snapshots.sh b/test/suites/snapshots.sh
index ce849f6d0d..81a900f493 100644
--- a/test/suites/snapshots.sh
+++ b/test/suites/snapshots.sh
@@ -233,7 +233,7 @@ test_snap_expiry() {
lxc config set c1 snapshots.expiry '1d'
lxc snapshot c1
- ! lxc config show c1/snap1 | grep -q 'expires_at: 0001-01-01T00:00:00Z'
+ ! lxc config show c1/snap1 | grep -q 'expires_at: 0001-01-01T00:00:00Z' || false
lxc rm -f c1
}
From 346996e18decc1ef35cd910b229cccb3bf3b2de7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 19/33] tests: Fix negative tests in sql.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/sql.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/suites/sql.sh b/test/suites/sql.sh
index 7630dea637..15c54ceed7 100644
--- a/test/suites/sql.sh
+++ b/test/suites/sql.sh
@@ -1,9 +1,9 @@
# Test the lxd sql command.
test_sql() {
# Invalid arguments
- ! lxd sql
- ! lxd sql foo "SELECT * FROM CONFIG"
- ! lxd sql global ""
+ ! lxd sql || false
+ ! lxd sql foo "SELECT * FROM CONFIG" || false
+ ! lxd sql global "" || false
# Local database query
lxd sql local "SELECT * FROM config" | grep -q "core.https_address"
From add7ded9438956a2424610ce68511fbd39b431ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 20/33] tests: Fix negative tests in storage.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage.sh | 188 ++++++++++++++++++++---------------------
1 file changed, 94 insertions(+), 94 deletions(-)
diff --git a/test/suites/storage.sh b/test/suites/storage.sh
index c96fdc815b..9b479929d8 100644
--- a/test/suites/storage.sh
+++ b/test/suites/storage.sh
@@ -20,7 +20,7 @@ test_storage() {
lxc storage volume create "$storage_pool" "$storage_volume"
# Test resizing/applying quota to a storage volume's of type container fails.
- ! lxc storage volume set "$storage_pool" "$storage_volume" size 200MB
+ ! lxc storage volume set "$storage_pool" "$storage_volume" size 200MB || false
# Test setting description on a storage volume
lxc storage volume show "$storage_pool" "$storage_volume" | sed 's/^description:.*/description: bar/' | lxc storage volume edit "$storage_pool" "$storage_volume"
@@ -81,7 +81,7 @@ test_storage() {
# Check that we can't create a loop file in a non-LXD owned location.
INVALID_LOOP_FILE="$(mktemp -p "${LXD_DIR}" XXXXXXXXX)-invalid-loop-file"
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool1" zfs source="${INVALID_LOOP_FILE}"
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool1" zfs source="${INVALID_LOOP_FILE}" || false
# Let LXD use an already existing dataset.
zfs create -p -o mountpoint=none "lxdtest-$(basename "${LXD_DIR}")-pool1/existing-dataset-as-pool"
@@ -102,12 +102,12 @@ test_storage() {
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool2" zfs source="${loop_device_1}"
# Test that no invalid zfs storage pool configuration keys can be set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.thinpool_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.use_thinpool=false
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.vg_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.block.filesystem=ext4
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.block.mount_options=discard
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.size=2GB
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.thinpool_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.use_thinpool=false || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs lvm.vg_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.block.filesystem=ext4 || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.block.mount_options=discard || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-zfs-pool-config" zfs volume.size=2GB || false
# Test that all valid zfs storage pool configuration keys can be set.
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-valid-zfs-pool-config" zfs volume.zfs.remove_snapshots=true
@@ -136,19 +136,19 @@ test_storage() {
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool4" btrfs source="${loop_device_2}"
# Check that we cannot create storage pools inside of ${LXD_DIR} other than ${LXD_DIR}/storage-pools/{pool_name}.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir" btrfs source="${LXD_DIR}"
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir" btrfs source="${LXD_DIR}" || false
# Test that no invalid btrfs storage pool configuration keys can be set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.thinpool_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.use_thinpool=false
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.vg_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.block.filesystem=ext4
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.block.mount_options=discard
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.size=2GB
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.zfs.remove_snapshots=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.zfs.use_refquota=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs zfs.clone_copy=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs zfs.pool_name=bla
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.thinpool_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.use_thinpool=false || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs lvm.vg_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.block.filesystem=ext4 || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.block.mount_options=discard || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.size=2GB || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.zfs.remove_snapshots=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs volume.zfs.use_refquota=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs zfs.clone_copy=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-btrfs-pool-config" btrfs zfs.pool_name=bla || false
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-valid-btrfs-pool-config" btrfs rsync.bwlimit=1024
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-valid-btrfs-pool-config"
@@ -162,7 +162,7 @@ test_storage() {
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5" dir
# Check that we cannot create storage pools inside of ${LXD_DIR} other than ${LXD_DIR}/storage-pools/{pool_name}.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir" dir source="${LXD_DIR}"
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir" dir source="${LXD_DIR}" || false
# Check that we can create storage pools inside of ${LXD_DIR}/storage-pools/{pool_name}.
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir" dir source="${LXD_DIR}/storage-pools/lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir"
@@ -170,17 +170,17 @@ test_storage() {
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-pool5_under_lxd_dir"
# Test that no invalid dir storage pool configuration keys can be set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.thinpool_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.use_thinpool=false
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.vg_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir size=10GB
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.block.filesystem=ext4
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.block.mount_options=discard
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.size=2GB
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.zfs.remove_snapshots=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.zfs.use_refquota=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir zfs.clone_copy=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir zfs.pool_name=bla
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.thinpool_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.use_thinpool=false || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir lvm.vg_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir size=10GB || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.block.filesystem=ext4 || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.block.mount_options=discard || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.size=2GB || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.zfs.remove_snapshots=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir volume.zfs.use_refquota=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir zfs.clone_copy=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-dir-pool-config" dir zfs.pool_name=bla || false
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-valid-dir-pool-config" dir rsync.bwlimit=1024
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-valid-dir-pool-config"
@@ -195,7 +195,7 @@ test_storage() {
# shellcheck disable=SC2154
# Should fail if vg does not exist, since we have no way of knowing where
# to create the vg without a block device path set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool10" lvm source=dummy_vg_1 volume.size=25MB
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool10" lvm source=dummy_vg_1 volume.size=25MB || false
# shellcheck disable=SC2154
deconfigure_loop_device "${loop_file_5}" "${loop_device_5}"
@@ -223,11 +223,11 @@ test_storage() {
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" lvm lvm.use_thinpool=false volume.size=25MB
# Test that no invalid lvm storage pool configuration keys can be set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm volume.zfs.remove_snapshots=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm volume.zfs_use_refquota=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm zfs.clone_copy=true
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm zfs.pool_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm lvm.use_thinpool=false lvm.thinpool_name="lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config"
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm volume.zfs.remove_snapshots=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm volume.zfs_use_refquota=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm zfs.clone_copy=true || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm zfs.pool_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" lvm lvm.use_thinpool=false lvm.thinpool_name="lxdtest-$(basename "${LXD_DIR}")-invalid-lvm-pool-config" || false
# Test that all valid lvm storage pool configuration keys can be set.
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-valid-lvm-pool-config-pool16" lvm lvm.thinpool_name="lxdtest-$(basename "${LXD_DIR}")-valid-lvm-pool-config"
@@ -267,34 +267,34 @@ test_storage() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1
lxc storage volume set "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 zfs.use_refquota true
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2-renamed
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2-renamed c4pool2
@@ -313,34 +313,34 @@ test_storage() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3 c5pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3 c5pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3 c5pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3 c5pool3 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c5pool3 c5pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c5pool3 c5pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c5pool3 c5pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool3" c5pool3 c5pool3 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4 c5pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4 c5pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4 c5pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4 c5pool3 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c6pool4 c5pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c6pool4 c5pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c6pool4 c5pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool4" c6pool4 c5pool3 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3 c7pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3 c7pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3 c7pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3 c7pool3 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c7pool3 c7pool3 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c7pool3 c7pool3 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool3" custom/c7pool3 c7pool3 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool3" c7pool3 c7pool3 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c8pool4 c8pool4 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c8pool4 c8pool4 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool4" custom/c8pool4 c8pool4 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4 testDevice
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4 c8pool4-renamed
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool4" c8pool4-renamed c8pool4
@@ -354,18 +354,18 @@ test_storage() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5 c9pool5 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5 c9pool5 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5 c9pool5 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5 c9pool5 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c9pool5 c9pool5 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c9pool5 c9pool5 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c9pool5 c9pool5 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool5" c9pool5 c9pool5 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c11pool5 c11pool5 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c11pool5 c11pool5 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool5" custom/c11pool5 c11pool5 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5 testDevice
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5 c11pool5-renamed
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool5" c11pool5-renamed c11pool5
@@ -433,98 +433,98 @@ test_storage() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6 c10pool6 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6 c10pool6 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6 c10pool6 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6 c10pool6 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c10pool6 c10pool6 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c10pool6 c10pool6 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c10pool6 c10pool6 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6 c10pool6 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6 c12pool6 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6 c12pool6 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6 c12pool6 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6 c12pool6 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c12pool6 c12pool6 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c12pool6 c12pool6 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool6" custom/c12pool6 c12pool6 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool6" c12pool6 c12pool6 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11 c10pool11 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11 c10pool11 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11 c10pool11 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11 c10pool11 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c10pool11 c10pool11 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c10pool11 c10pool11 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c10pool11 c10pool11 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool11" c10pool11 c10pool11 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11 c10pool11 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11 c10pool11 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11 c10pool11 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11 c10pool11 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c12pool11 c10pool11 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c12pool11 c10pool11 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool11" custom/c12pool11 c10pool11 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool11" c12pool11 c10pool11 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12 c10pool12 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12 c10pool12 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12 c10pool12 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12 c10pool12 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c10pool12 c10pool12 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c10pool12 c10pool12 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c10pool12 c10pool12 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool12" c10pool12 c10pool12 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12 c12pool12 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12 c12pool12 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12 c12pool12 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12 c12pool12 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c12pool12 c12pool12 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c12pool12 c12pool12 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool12" custom/c12pool12 c12pool12 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool12" c12pool12 c12pool12 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13 c10pool13 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13 c10pool13 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13 c10pool13 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13 c10pool13 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c10pool13 c10pool13 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c10pool13 c10pool13 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c10pool13 c10pool13 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool13" c10pool13 c10pool13 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13 c12pool13 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13 c12pool13 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13 c12pool13 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13 c12pool13 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c12pool13 c12pool13 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c12pool13 c12pool13 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool13" custom/c12pool13 c12pool13 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool13" c12pool13 c12pool13 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14 c10pool14 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14 c10pool14 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14 c10pool14 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14 c10pool14 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c10pool14 c10pool14 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c10pool14 c10pool14 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c10pool14 c10pool14 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool14" c10pool14 c10pool14 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14 c12pool14 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14 c12pool14 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14 c12pool14 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14 c12pool14 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c12pool14 c12pool14 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c12pool14 c12pool14 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool14" custom/c12pool14 c12pool14 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool14" c12pool14 c12pool14 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15 c10pool15 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15 c10pool15 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15 c10pool15 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15 c10pool15 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c10pool15 c10pool15 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c10pool15 c10pool15 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c10pool15 c10pool15 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c10pool15 c10pool15 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15 c12pool15 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15 c12pool15 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15 c12pool15 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15 c12pool15 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c12pool15 c12pool15 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c12pool15 c12pool15 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" custom/c12pool15 c12pool15 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-non-thinpool-pool15" c12pool15 c12pool15 testDevice
fi
@@ -540,50 +540,50 @@ test_storage() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7 c13pool7 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7 c13pool7 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7 c13pool7 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7 c13pool7 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c13pool7 c13pool7 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c13pool7 c13pool7 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c13pool7 c13pool7 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool7" c13pool7 c13pool7 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7 c14pool7 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7 c14pool7 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7 c14pool7 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7 c14pool7 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c14pool7 c14pool7 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c14pool7 c14pool7 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool7" custom/c14pool7 c14pool7 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool7" c14pool7 c14pool7 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8 c15pool8 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8 c15pool8 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8 c15pool8 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8 c15pool8 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c15pool8 c15pool8 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c15pool8 c15pool8 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c15pool8 c15pool8 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool8" c15pool8 c15pool8 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8 c16pool8 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8 c16pool8 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8 c16pool8 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8 c16pool8 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c16pool8 c16pool8 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c16pool8 c16pool8 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool8" custom/c16pool8 c16pool8 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool8" c16pool8 c16pool8 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9 c17pool9 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9 c17pool9 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9 c17pool9 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9 c17pool9 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c17pool9 c17pool9 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c17pool9 c17pool9 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c17pool9 c17pool9 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool9" c17pool9 c17pool9 testDevice
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9 testDevice
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c18pool9 c18pool9 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c18pool9 c18pool9 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool9" custom/c18pool9 c18pool9 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9 testDevice
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9 c18pool9-renamed
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool9" c18pool9-renamed c18pool9
@@ -815,7 +815,7 @@ test_storage() {
lxc storage create "$storage_pool" "$lxd_backend"
lxc init -s "${storage_pool}" testimage c1
# The storage pool will not be removed since it has c1 attached to it
- ! lxc storage delete "${storage_pool}"
+ ! lxc storage delete "${storage_pool}" || false
lxc delete c1
# The storage pool will be deleted since the testimage is also attached to
# the default pool
From c0456066dec3845fc63890fd7f8ec6d41ef33932 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:49 +0100
Subject: [PATCH 21/33] tests: Fix negative tests in storage_driver_ceph.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage_driver_ceph.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/test/suites/storage_driver_ceph.sh b/test/suites/storage_driver_ceph.sh
index 174269642c..42d8ce747c 100644
--- a/test/suites/storage_driver_ceph.sh
+++ b/test/suites/storage_driver_ceph.sh
@@ -34,9 +34,9 @@ test_storage_driver_ceph() {
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-pool2" ceph source="lxdtest-$(basename "${LXD_DIR}")-existing-osd-pool" volume.size=25MB ceph.osd.pg_num=1
# Test that no invalid ceph storage pool configuration keys can be set.
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.thinpool_name=bla
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.use_thinpool=false
- ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.vg_name=bla
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.thinpool_name=bla || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.use_thinpool=false || false
+ ! lxc storage create "lxdtest-$(basename "${LXD_DIR}")-invalid-ceph-pool-config" ceph lvm.vg_name=bla || false
# Test that all valid ceph storage pool configuration keys can be set.
lxc storage create "lxdtest-$(basename "${LXD_DIR}")-valid-ceph-pool-config" ceph volume.block.filesystem=ext4 volume.block.mount_options=discard volume.size=2GB ceph.rbd.clone_copy=true ceph.osd.pg_num=1
@@ -81,34 +81,34 @@ test_storage_driver_ceph() {
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c1pool1 c1pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c1pool1 c1pool1
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool1" custom/c2pool2 c2pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool1" c2pool2 c2pool2
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c3pool1 c3pool1
lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2
lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice /opt
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice2 /opt
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")-pool2" custom/c4pool2 c4pool2 testDevice2 /opt || false
lxc storage volume detach "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2 c4pool2-renamed
lxc storage volume rename "lxdtest-$(basename "${LXD_DIR}")-pool2" c4pool2-renamed c4pool2
From c2e7e3279ec68f1f6a6475d298d78345f36fa04c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:50 +0100
Subject: [PATCH 22/33] tests: Fix negative tests in
storage_local_volume_handling.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage_local_volume_handling.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/suites/storage_local_volume_handling.sh b/test/suites/storage_local_volume_handling.sh
index 2a395d5bf7..b2c4bdb210 100644
--- a/test/suites/storage_local_volume_handling.sh
+++ b/test/suites/storage_local_volume_handling.sh
@@ -76,7 +76,7 @@ test_storage_local_volume_handling() {
lxc storage volume copy "lxdtest-$(basename "${LXD_DIR}")-${driver}/vol1" "lxdtest-$(basename "${LXD_DIR}")-${driver}1/vol1"
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${driver}1" vol1
lxc storage volume move "lxdtest-$(basename "${LXD_DIR}")-${driver}/vol1" "lxdtest-$(basename "${LXD_DIR}")-${driver}1/vol1"
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}" vol1
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}" vol1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" vol1
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${driver}1" vol1
lxc storage delete "lxdtest-$(basename "${LXD_DIR}")-${driver}1"
@@ -92,7 +92,7 @@ test_storage_local_volume_handling() {
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${target_driver}" vol1
lxc storage volume move "lxdtest-$(basename "${LXD_DIR}")-${source_driver}/vol1" "lxdtest-$(basename "${LXD_DIR}")-${target_driver}/vol1"
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${source_driver}" vol1
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${source_driver}" vol1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${target_driver}" vol1
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${target_driver}" vol1
@@ -102,7 +102,7 @@ test_storage_local_volume_handling() {
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${source_driver}" vol1
lxc storage volume move "lxdtest-$(basename "${LXD_DIR}")-${target_driver}/vol1" "lxdtest-$(basename "${LXD_DIR}")-${source_driver}/vol1"
- ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${target_driver}" vol1
+ ! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${target_driver}" vol1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${source_driver}" vol1
lxc storage volume delete "lxdtest-$(basename "${LXD_DIR}")-${source_driver}" vol1
fi
From ca792324941c6192b83bb395611c21348c0098fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:50 +0100
Subject: [PATCH 23/33] tests: Fix negative tests in storage_profiles.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage_profiles.sh | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/suites/storage_profiles.sh b/test/suites/storage_profiles.sh
index 1b93432f70..b59e388e4e 100644
--- a/test/suites/storage_profiles.sh
+++ b/test/suites/storage_profiles.sh
@@ -47,26 +47,26 @@ test_storage_profiles() {
# Check that we can't remove or change the root disk device since containers
# are actually using it.
- ! lxc profile device remove dummy rootfs
- ! lxc profile device set dummy rootfs pool "lxdtest-$(basename "${LXD_DIR}")-pool2"
+ ! lxc profile device remove dummy rootfs || false
+ ! lxc profile device set dummy rootfs pool "lxdtest-$(basename "${LXD_DIR}")-pool2" || false
# Give all the containers we started their own local root disk device.
for i in $(seq 1 2); do
- ! lxc config device add c"${i}" root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1"
+ ! lxc config device add c"${i}" root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1" || false
lxc config device add c"${i}" rootfs disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1"
done
# Try to set new pool. This should fail since there is a single container
# that has no local root disk device.
- ! lxc profile device set dummy rootfs pool "lxdtest-$(basename "${LXD_DIR}")-pool2"
+ ! lxc profile device set dummy rootfs pool "lxdtest-$(basename "${LXD_DIR}")-pool2" || false
# This should work since it doesn't change the pool property.
lxc profile device set dummy rootfs pool "lxdtest-$(basename "${LXD_DIR}")-pool1"
# Check that we can not remove the root disk device since there is a single
# container that is still using it.
- ! lxc profile device remove dummy rootfs
+ ! lxc profile device remove dummy rootfs || false
# Give the last container a local root disk device.
- ! lxc config device add c3 root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1"
+ ! lxc config device add c3 root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1" || false
lxc config device add c3 rootfs disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1"
# Try to set new pool. This should work since the container has a local disk
@@ -77,16 +77,16 @@ test_storage_profiles() {
lxc profile device remove dummy rootfs
# Add back a root device to the profile.
- ! lxc profile device add dummy rootfs1 disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1"
+ ! lxc profile device add dummy rootfs1 disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool1" || false
# Try to add another root device to the profile that tries to set a pool
# property. This should fail. This is also a test for whether it is possible
# to put multiple disk devices on the same path. This must fail!
- ! lxc profile device add dummy rootfs2 disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool2"
+ ! lxc profile device add dummy rootfs2 disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")-pool2" || false
# Add another root device to the profile that does not set a pool property.
# This should not work since it would use the same path.
- ! lxc profile device add dummy rootfs3 disk path="/"
+ ! lxc profile device add dummy rootfs3 disk path="/" || false
# Create a second profile.
lxc profile create dummyDup
@@ -98,15 +98,15 @@ test_storage_profiles() {
# Verify that we cannot create a container with profiles that have
# contradicting root devices.
- ! lxc launch testimage cConflictingProfiles --p dummy -p dummyDup -p dummyNoDup
+ ! lxc launch testimage cConflictingProfiles --p dummy -p dummyDup -p dummyNoDup || false
# And that even with a local disk, a container can't have multiple root devices
- ! lxc launch testimage cConflictingProfiles -s "lxdtest-$(basename "${LXD_DIR}")-pool2" -p dummy -p dummyDup -p dummyNoDup
+ ! lxc launch testimage cConflictingProfiles -s "lxdtest-$(basename "${LXD_DIR}")-pool2" -p dummy -p dummyDup -p dummyNoDup || false
# Check that we cannot assign conflicting profiles to a container that
# relies on another profiles root disk device.
lxc launch testimage cOnDefault
- ! lxc profile assign cOnDefault default,dummyDup,dummyNoDup
+ ! lxc profile assign cOnDefault default,dummyDup,dummyNoDup || false
# Verify that we can create a container with two profiles that speficy the
# same root disk device.
@@ -116,14 +116,14 @@ test_storage_profiles() {
lxc profile device remove dummy rootfs1
# Try to remove the root disk device from the second profile.
- ! lxc profile device remove dummyDup rootfs1
+ ! lxc profile device remove dummyDup rootfs1 || false
# Test that we can't remove the root disk device from the containers config
# when the profile it is attached to specifies no root device.
for i in $(seq 1 3); do
- ! lxc config device remove c"${i}" root
+ ! lxc config device remove c"${i}" root || false
# Must fail.
- ! lxc profile assign c"${i}" dummyDup,dummyNoDup
+ ! lxc profile assign c"${i}" dummyDup,dummyNoDup || false
done
lxc delete -f cNonConflictingProfiles
From 22ea356db15f7e73abff9e06c982978a35a26ba7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:50 +0100
Subject: [PATCH 24/33] tests: Fix negative tests in storage_snapshots.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage_snapshots.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/suites/storage_snapshots.sh b/test/suites/storage_snapshots.sh
index e00994b1e3..c810e7f295 100644
--- a/test/suites/storage_snapshots.sh
+++ b/test/suites/storage_snapshots.sh
@@ -38,11 +38,11 @@ test_storage_volume_snapshots() {
lxc file delete c1/mnt/testfile
# Validate file
- ! lxc exec c1 -- test -f /mnt/testfile
+ ! lxc exec c1 -- test -f /mnt/testfile || false
# This should fail since you cannot restore a snapshot when the target volume
# is attached to the container
- ! lxc storage volume restore "${storage_pool}" "${storage_volume}" snap0
+ ! lxc storage volume restore "${storage_pool}" "${storage_volume}" snap0 || false
lxc stop c1
lxc storage volume restore "${storage_pool}" "${storage_volume}" snap0
From 38532151826a2c7adde767336f9be03517ec7319 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:50 +0100
Subject: [PATCH 25/33] tests: Fix negative tests in storage_volume_attach.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/storage_volume_attach.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/suites/storage_volume_attach.sh b/test/suites/storage_volume_attach.sh
index 46b9e0c430..1008ffebbc 100644
--- a/test/suites/storage_volume_attach.sh
+++ b/test/suites/storage_volume_attach.sh
@@ -75,7 +75,7 @@ test_storage_volume_attach() {
ISOLATED_GID_BASE="$(lxc exec c1 -- cat /proc/self/gid_map | awk '{print $2}')"
[ "$(stat -c %u:%g "${PATH_TO_CHECK}")" = "${ISOLATED_UID_BASE}:${ISOLATED_GID_BASE}" ]
- ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")" testvolume c2 testvolume
+ ! lxc storage volume attach "lxdtest-$(basename "${LXD_DIR}")" testvolume c2 testvolume || false
# give container standard mapping
lxc config set c1 security.idmap.isolated false
From 008de0997e195011dab924119780244edbb3f401 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 4 Feb 2019 18:23:50 +0100
Subject: [PATCH 26/33] tests: Fix negative tests in template.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/template.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/suites/template.sh b/test/suites/template.sh
index ee2319118f..7895e565f8 100644
--- a/test/suites/template.sh
+++ b/test/suites/template.sh
@@ -8,7 +8,7 @@ test_template() {
lxc init template-test template
# Confirm that template application is delayed to first start
- ! lxc file pull template/template -
+ ! lxc file pull template/template - || false
# Validate that the template is applied
lxc start template
@@ -32,7 +32,7 @@ test_template() {
lxc launch template-test template
# Confirm that the template doesn't trigger on create
- ! lxc file pull template/template -
+ ! lxc file pull template/template - || false
if [ "$lxd_backend" = "lvm" ] || [ "$lxd_backend" = "ceph" ]; then
lxc stop template --force
fi
@@ -41,7 +41,7 @@ test_template() {
lxc copy template template1
# Confirm that template application is delayed to first start
- ! lxc file pull template1/template -
+ ! lxc file pull template1/template - || false
# Validate that the template is applied
lxc start template1
@@ -75,7 +75,7 @@ test_template() {
lxc init template-test template
# Confirm that template application is delayed to first start
- ! lxc file pull template/template -
+ ! lxc file pull template/template - || false
# Validate that the template is applied
lxc start template
From b96764427cebc00f1e3c3df3518b8b939350aaf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:25:27 -0500
Subject: [PATCH 27/33] tests: Fix bad test in external_auth
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
test/suites/external_auth.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/test/suites/external_auth.sh b/test/suites/external_auth.sh
index a929ef84ba..a4dc5b749e 100644
--- a/test/suites/external_auth.sh
+++ b/test/suites/external_auth.sh
@@ -11,18 +11,20 @@ test_macaroon_auth() {
lxc config set candid.api.key "${key}"
# invalid credentials make the remote add fail
- # shellcheck disable=SC2039
- ! cat || false <<EOF | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate
+ ! (
+ cat <<EOF
wrong-user
wrong-pass
EOF
+ ) | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate || false
# valid credentials work
- # shellcheck disable=SC2039
- cat <<EOF | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate
+ (
+ cat <<EOF
user1
pass1
EOF
+ ) | lxc remote add macaroon-remote "https://$LXD_ADDR" --auth-type candid --accept-certificate
# run a lxc command through the new remote
lxc config show macaroon-remote: | grep -q candid.api.url
From 0b1f48f69d732d5284a531203c810e4c96459ca3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:26:18 -0500
Subject: [PATCH 28/33] tests: Fix bad test in security
---
test/suites/security.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/suites/security.sh b/test/suites/security.sh
index 147bc07673..e95ab1d1c6 100644
--- a/test/suites/security.sh
+++ b/test/suites/security.sh
@@ -81,7 +81,7 @@ test_security() {
# Verify that we can't be tricked into using privileged containers
! lxc config set c1 security.privileged true || false
- ! lxc config set c1 raw.idmap "both 1000 1000" || false
+ ! lxc config set c1 raw.idmap "both 0 1000" || false
! lxc config set c1 raw.lxc "lxc.idmap=" || false
! lxc config set c1 raw.lxc "lxc.include=" || false
@@ -92,7 +92,7 @@ test_security() {
# Verify that a profile can't be changed to trick us into using privileged
# containers
! lxc profile set default security.privileged true || false
- ! lxc profile set default raw.idmap "both 1000 1000" || false
+ ! lxc profile set default raw.idmap "both 0 1000" || false
! lxc profile set default raw.lxc "lxc.idmap=" || false
! lxc profile set default raw.lxc "lxc.include=" || false
From 893b92db3710cf7825ba1ea1b26110cc76f9144a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:26:32 -0500
Subject: [PATCH 29/33] tests: Fix bad test in sql
---
test/suites/sql.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/test/suites/sql.sh b/test/suites/sql.sh
index 15c54ceed7..66565e1262 100644
--- a/test/suites/sql.sh
+++ b/test/suites/sql.sh
@@ -1,7 +1,6 @@
# Test the lxd sql command.
test_sql() {
# Invalid arguments
- ! lxd sql || false
! lxd sql foo "SELECT * FROM CONFIG" || false
! lxd sql global "" || false
From 28730b513371a74a0e34c93250884ac2ccca4814 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:48:36 -0500
Subject: [PATCH 30/33] tests: Fix bad test in clustering
---
test/suites/clustering.sh | 3 ---
1 file changed, 3 deletions(-)
diff --git a/test/suites/clustering.sh b/test/suites/clustering.sh
index 44a5158a40..02f2996f56 100644
--- a/test/suites/clustering.sh
+++ b/test/suites/clustering.sh
@@ -14,9 +14,6 @@ test_clustering_enable() {
lxc profile device add default root disk path="/" pool="default"
lxc launch testimage c1
- # A node name is required.
- ! lxc cluster enable || false
-
# Enable clustering.
lxc cluster enable node1
lxc cluster list | grep -q node1
From 2992d1194e106091dfb3645798c4aa7bca2b9e49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:48:44 -0500
Subject: [PATCH 31/33] tests: Fix bad test in storage
---
test/suites/storage.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/test/suites/storage.sh b/test/suites/storage.sh
index 9b479929d8..5a3e43a081 100644
--- a/test/suites/storage.sh
+++ b/test/suites/storage.sh
@@ -19,8 +19,6 @@ test_storage() {
lxc storage show "$storage_pool" | grep -q 'description: foo'
lxc storage volume create "$storage_pool" "$storage_volume"
- # Test resizing/applying quota to a storage volume's of type container fails.
- ! lxc storage volume set "$storage_pool" "$storage_volume" size 200MB || false
# Test setting description on a storage volume
lxc storage volume show "$storage_pool" "$storage_volume" | sed 's/^description:.*/description: bar/' | lxc storage volume edit "$storage_pool" "$storage_volume"
From 6edb21bd22702c00343f4313f995caf872d882eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 17:49:04 -0500
Subject: [PATCH 32/33] tests: Fix bad test in container local pool handling
---
test/suites/container_local_cross_pool_handling.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/suites/container_local_cross_pool_handling.sh b/test/suites/container_local_cross_pool_handling.sh
index 78a5533429..dcf51cb557 100644
--- a/test/suites/container_local_cross_pool_handling.sh
+++ b/test/suites/container_local_cross_pool_handling.sh
@@ -61,7 +61,7 @@ test_container_local_cross_pool_handling() {
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1"
- ! lxc list c1 || false
+ ! lxc info c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc delete -f c2
@@ -74,7 +74,7 @@ test_container_local_cross_pool_handling() {
! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1 || false
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1" --container-only
- ! lxc list c1 || false
+ ! lxc info c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0 || false
! lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1 || false
@@ -89,7 +89,7 @@ test_container_local_cross_pool_handling() {
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
lxc delete -f c2
lxc move c1 c2 -s "lxdtest-$(basename "${LXD_DIR}")-${driver}1"
- ! lxc list c1 || false
+ ! lxc info c1 || false
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap0
lxc storage volume show "lxdtest-$(basename "${LXD_DIR}")-${driver}1" container/c2/snap1
From d1169091c3b687af7a1b3b488d24278d18feefc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 5 Feb 2019 18:51:19 -0500
Subject: [PATCH 33/33] lxd/containers: Refuse refresh on running containers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/containers_post.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lxd/containers_post.go b/lxd/containers_post.go
index d3dadacaa4..437f868902 100644
--- a/lxd/containers_post.go
+++ b/lxd/containers_post.go
@@ -316,6 +316,10 @@ func createFromMigration(d *Daemon, project string, req *api.ContainersPost) Res
if err != nil {
req.Source.Refresh = false
}
+
+ if c.IsRunning() {
+ return BadRequest(fmt.Errorf("Cannot refresh a running container"))
+ }
}
if !req.Source.Refresh {
More information about the lxc-devel
mailing list