Esempio n. 1
0
    def test_run(self):
        argv = ['--use-rhceph', '--verbose']
        self.assertEqual(0, main.run(argv))

        with mock.patch('platform.linux_distribution', lambda:
                        (('unknown', '', ''))):
            self.assertRaises(exc.UnsupportedPlatform, main.run, argv)
            self.assertEqual(0, main.run(argv + ['--default=sysvinit']))
Esempio n. 2
0
    def test_run(self):
        argv = ['--use-rhceph', '--verbose']
        self.assertEqual(0, main.run(argv))

        with mock.patch('platform.linux_distribution',
                        lambda: (('unknown', '', ''))):
            self.assertRaises(exc.UnsupportedPlatform, main.run, argv)
            self.assertEqual(0, main.run(argv + ['--default=sysvinit']))
Esempio n. 3
0
 def test_run_unknown_distro(self):
     argv = ['--use-rhceph', '--verbose']
     with mock.patch.multiple('platform',
                              system=lambda: 'Linux',
                              linux_distribution=lambda **kwargs:
                              (('unknown', '', ''))):
         self.assertRaises(exc.UnsupportedPlatform, main.run, argv)
         self.assertEqual(0, main.run(argv + ['--default=sysvinit']))
Esempio n. 4
0
 def test_run(self):
     argv = ['--use-rhceph', '--verbose']
     self.assertEqual(0, main.run(argv))