c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# lxc: linux Container library
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# Serge Hallyn <serge.hallyn@ubuntu.com>
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# This is a test for dependency between snapshots
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# When container c2 is created as an overlayfs clone of c1, then
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# we record it as such, because c1 cannot be deleted until c2 is
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# deleted. Once c2 is deleted, c1 should be delete-able.
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# This library is free software; you can redistribute it and/or
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# modify it under the terms of the GNU Lesser General Public
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# License as published by the Free Software Foundation; either
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# version 2.1 of the License, or (at your option) any later version.
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# This library is distributed in the hope that it will be useful,
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# but WITHOUT ANY WARRANTY; without even the implied warranty of
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# Lesser General Public License for more details.
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# You should have received a copy of the GNU Lesser General Public
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# License along with this library; if not, write to the Free Software
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn# This test assumes an Ubuntu host
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn echo "Not running this test as overlay is not available"
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn lxc-destroy -n snapdeptest$i > /dev/null 2>&1 || true
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn lxc-destroy -n snapdeptest > /dev/null 2>&1 || true
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn m=`wc -l /var/lib/lxc/snapdeptest/lxc_snapshots | awk '{ print $1 }'`
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallyn echo "FAIL: clone did not prevent deletion"
d0a6bd39400a6d14cfec94ad647f3af1bda1e321Christian Brauner lxc-copy -s -n snapdeptest -N snapdeptest$i
c4532a2036fd4a9283275b499b7a379fa9689172Serge Hallynecho "Snapshot clone dependency test passed"