~pgraner/ubuntu-server-iso-testing/arm-changes

« back to all changes in this revision

Viewing changes to test_cases/multi-lvm/test

  • Committer: James Page
  • Date: 2011-12-15 11:25:10 UTC
  • Revision ID: james.page@canonical.com-20111215112510-t3paqzj0i0qgfq20
Updates for multi-lvm test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
3
# Copyright (C) 2010, Canonical Ltd (http://www.canonical.com/)
 
4
#
 
5
# This file is part of ubuntu-server-iso-testing.
 
6
 
7
# ubuntu-server-iso-testing is free software: you can redistribute it 
 
8
# and/or modify it under the terms of the GNU General Public License 
 
9
# as published by the Free Software Foundation, either version 3 of 
 
10
# the License, or (at your option) any later version.
 
11
 
12
# ubuntu-server-iso-testing is distributed in the hope that it will 
 
13
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
 
14
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU General Public License for more details.
 
16
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with ubuntu-server-iso-testing.  If not, see 
 
19
# <http://www.gnu.org/licenses/>.
 
20
 
21
 
 
22
 
 
23
import logging
 
24
import os.path
 
25
import socket
 
26
import subprocess
 
27
import unittest
 
28
 
 
29
logging.basicConfig(level=logging.INFO)
 
30
 
 
31
class LvmTest(unittest.TestCase):
 
32
 
 
33
    def testRootMount(self):
 
34
        cmd = ["mount"]
 
35
        logging.debug("Cmd: %s" % (cmd))
 
36
        output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
 
37
        logging.debug("Cmd output: %s" % (output))
 
38
        self.assertTrue(len(output.split("\n")) > 0)
 
39
        l = output.split("\n")[0]
 
40
        self.assertTrue(l.startswith('/dev/mapper/'), l)
 
41
 
 
42
    def testVgs(self):
 
43
        cmd = ["vgs", "--noheadings"]
 
44
        logging.debug("Cmd: %s" % (cmd))
 
45
        output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
 
46
        logging.debug("Cmd output: %s" % (output))
 
47
        self.assertTrue(len(output.split("\n")) > 0)
 
48
        l = output.split("\n")[0]
 
49
        self.assertTrue(socket.gethostname() in l, l)
 
50
 
 
51
    def testLvs(self):
 
52
        cmd = ["lvs", "--noheadings"]
 
53
        logging.debug("Cmd: %s" % (cmd))
 
54
        output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
 
55
        logging.debug("Cmd output: %s" % (output))
 
56
        self.assertTrue(len(output.split("\n")) > 0)
 
57
        l = output.split("\n")[0]
 
58
        self.assertTrue('root' in l, l)
 
59
 
 
60
if __name__ == '__main__':
 
61
    unittest.main()