4 # Copyright 2016 RIFT.IO Inc
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
23 import rift
.rwcal
.cloudsim
.lxc
as lxc
24 import rift
.rwcal
.cloudsim
.lvm
as lvm
27 logger
= logging
.getLogger('rwcal-test')
31 template
= os
.path
.realpath("../rift/cal/lxc-fedora-rift.lxctemplate")
32 tarfile
= "/net/strange/localdisk/jdowner/lxc.tar.gz"
35 lvm
.create(volume
, '/lvm/rift-test.img')
37 master
= lxc
.create_container('test-master', template
, volume
, tarfile
)
40 for index
in range(5):
41 snapshots
.append(master
.snapshot('test-snap-{}'.format(index
+ 1)))
43 for snapshot
in snapshots
:
52 if __name__
== "__main__":
53 logging
.basicConfig(level
=logging
.DEBUG
)