示例#1
0
    def test_lvresize(self):
        '''
        Test to return information about the logical volume(s)
        '''
        mock = MagicMock(return_value={'retcode': 1})
        with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}):
            self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {})

        mock = MagicMock(return_value={'retcode': 0})
        with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}):
            self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {})
示例#2
0
    def test_lvresize(self):
        '''
        Test to return information about the logical volume(s)
        '''
        mock = MagicMock(return_value={'retcode': 1})
        with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}):
            self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {})

        mock = MagicMock(return_value={'retcode': 0})
        with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}):
            self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {})
示例#3
0
    def test_lvresize(self):
        '''
        Test to return information about the logical volume(s)
        '''
        self.assertEqual(linux_lvm.lvresize(1, None, 1), {})

        self.assertEqual(linux_lvm.lvresize(None, None, None), {})

        mock = MagicMock(return_value='A')
        with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}):
            self.assertDictEqual(linux_lvm.lvresize('A', 1),
                                 {'Output from lvresize': 'A'})
示例#4
0
    def test_lvresize(self):
        """
        Test to return information about the logical volume(s)
        """
        self.assertEqual(linux_lvm.lvresize(1, None, 1), {})

        self.assertEqual(linux_lvm.lvresize(None, None, None), {})

        mock = MagicMock(return_value="A")
        with patch.dict(linux_lvm.__salt__, {"cmd.run": mock}):
            self.assertDictEqual(
                linux_lvm.lvresize("A", 1), {"Output from lvresize": "A"}
            )
示例#5
0
    def test_lvresize(self):
        """
        Tests to resize an LVM logical volume
        """
        self.assertEqual(linux_lvm.lvresize(1, None, 1), {})

        self.assertEqual(linux_lvm.lvresize(None, None, None), {})

        mock = MagicMock(return_value={"retcode": 0, "stderr": ""})
        with patch.dict(linux_lvm.__salt__, {"cmd.run_all": mock}):
            self.assertDictEqual(
                linux_lvm.lvresize(12, "/dev/fakevg/fakelv"),
                {
                    "Output from lvresize": 'Logical volume "/dev/fakevg/fakelv" successfully resized.'
                },
            )