[lxc-devel] [lxd/master] lxc/export: Bump expiry to 24 hours
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Jun 19 19:09:45 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 582 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190619/9a869052/attachment.bin>
-------------- next part --------------
From 9dc81e30b7020696d117353465b089dd76a60d71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 19 Jun 2019 15:07:24 -0400
Subject: [PATCH 1/2] tests: Always pass --force to stop/restart
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_devices_nic_p2p.sh | 2 +-
test/suites/container_devices_nic_physical.sh | 4 ++--
test/suites/container_devices_nic_sriov.sh | 8 ++++----
test/suites/storage_snapshots.sh | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/test/suites/container_devices_nic_p2p.sh b/test/suites/container_devices_nic_p2p.sh
index a3f8b12b7e..4e45e1fc33 100644
--- a/test/suites/container_devices_nic_p2p.sh
+++ b/test/suites/container_devices_nic_p2p.sh
@@ -242,7 +242,7 @@ test_container_devices_nic_p2p() {
fi
# Now add a nic to a stopped container with routes.
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
lxc config device add "${ctName}" eth0 nic \
nictype=p2p \
ipv4.routes="192.0.2.2${ipRand}/32" \
diff --git a/test/suites/container_devices_nic_physical.sh b/test/suites/container_devices_nic_physical.sh
index 35f35135c9..9f632c7202 100644
--- a/test/suites/container_devices_nic_physical.sh
+++ b/test/suites/container_devices_nic_physical.sh
@@ -38,7 +38,7 @@ test_container_devices_nic_physical() {
fi
# Stop container and check MTU is restored.
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
# Check original MTU is restored on physical device.
if lxc info | grep 'network_phys_macvlan_mtu: "true"' ; then
@@ -164,7 +164,7 @@ test_container_devices_nic_physical() {
mtu=1402 #Higher than 1400 boot time value above
# Stop the container, LXC doesn't know about the nic, so we will rely on LXD to restore it.
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
# Check original MTU is restored on physical device.
if lxc info | grep 'network_phys_macvlan_mtu: "true"' ; then
diff --git a/test/suites/container_devices_nic_sriov.sh b/test/suites/container_devices_nic_sriov.sh
index 840ba9d430..90a1f818fa 100644
--- a/test/suites/container_devices_nic_sriov.sh
+++ b/test/suites/container_devices_nic_sriov.sh
@@ -69,7 +69,7 @@ test_container_devices_nic_sriov() {
fi
fi
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
# Set custom MAC
lxc config device set "${ctName}" eth0 hwaddr "${ctMAC1}"
@@ -82,7 +82,7 @@ test_container_devices_nic_sriov() {
false
fi
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
# Disable mac filtering and try fresh boot
lxc config device set "${ctName}" eth0 security.mac_filtering false
@@ -108,7 +108,7 @@ test_container_devices_nic_sriov() {
false
fi
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
# Test setting MAC offline
lxc config device set "${ctName}" eth1 hwaddr "${ctMAC2}"
@@ -121,5 +121,5 @@ test_container_devices_nic_sriov() {
false
fi
- lxc stop "${ctName}"
+ lxc stop -f "${ctName}"
}
diff --git a/test/suites/storage_snapshots.sh b/test/suites/storage_snapshots.sh
index c810e7f295..cf160b14ce 100644
--- a/test/suites/storage_snapshots.sh
+++ b/test/suites/storage_snapshots.sh
@@ -44,7 +44,7 @@ test_storage_volume_snapshots() {
# is attached to the container
! lxc storage volume restore "${storage_pool}" "${storage_volume}" snap0 || false
- lxc stop c1
+ lxc stop -f c1
lxc storage volume restore "${storage_pool}" "${storage_volume}" snap0
lxc start c1
From 9057eb9c8a374b6b7df27381e8e6ba0690835db8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 19 Jun 2019 15:08:22 -0400
Subject: [PATCH 2/2] lxc/export: Expire the backup after 24 hours
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>
---
lxc/export.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lxc/export.go b/lxc/export.go
index 708c027ca1..e4e3025818 100644
--- a/lxc/export.go
+++ b/lxc/export.go
@@ -65,7 +65,7 @@ func (c *cmdExport) Run(cmd *cobra.Command, args []string) error {
req := api.ContainerBackupsPost{
Name: "",
- ExpiryDate: time.Now().Add(30 * time.Minute),
+ ExpiryDate: time.Now().Add(24 * time.Hour),
ContainerOnly: c.flagContainerOnly,
OptimizedStorage: c.flagOptimizedStorage,
}
More information about the lxc-devel
mailing list