fix test_create for mdadm module

This commit is contained in:
Volodymyr Samodid 2018-02-02 21:58:29 +02:00
parent fba972a09a
commit de6c8e4848
No known key found for this signature in database
GPG Key ID: 3F47E1D96850DDC0

View File

@ -46,18 +46,19 @@ class MdadmTestCase(TestCase, LoaderModuleMockMixin):
# where args between -v and -l could be in any order
self.assertEqual(len(args), 1)
self.assertEqual(len(args[0]), 17)
self.assertEqual(args[0][:5], [
self.assertEqual(args[0][:7], [
'mdadm',
'-C', '/dev/md0',
'-R',
'-v'])
self.assertEqual(args[0][8:], [
'-v',
'-l', '5',
])
self.assertEqual(args[0][10:], [
'-e', 'default',
'-n', '3',
'/dev/sdb1', '/dev/sdc1', '/dev/sdd1'])
self.assertEqual(sorted(args[0][5:8]), sorted(['--chunk', '256', '--force']))
self.assertIn('--chunk 256', ' '.join(args[0][5:8]))
self.assertEqual(sorted(args[0][7:10]), sorted(['--chunk', '256', '--force']))
self.assertIn('--chunk 256', ' '.join(args[0][7:10]))
self.assertEqual(kwargs, {'python_shell': False})
def test_create_test_mode(self):