Example #1
0
 def test_zfs_join_pool_volume_empty_params(self):
     """ zfs._join_pool_volume raises ValueError on invalid volume """
     with self.assertRaises(ValueError):
         zfs._join_pool_volume('', '')
Example #2
0
 def test_zfs_join_pool_volume_invalid_volume(self):
     """ zfs._join_pool_volume raises ValueError on invalid volume """
     with self.assertRaises(ValueError):
         zfs._join_pool_volume('rpool', None)
Example #3
0
 def test_zfs_join_pool_volume_invalid_pool(self):
     """ zfs._join_pool_volume raises ValueError on invalid pool """
     with self.assertRaises(ValueError):
         zfs._join_pool_volume(None, 'myvol')
Example #4
0
 def test_zfs_join_pool_volume_no_slash(self):
     """ zfs._join_pool_volume handles no slash """
     pool = 'rpool'
     volume = 'ROOT'
     self.assertEqual('rpool/ROOT', zfs._join_pool_volume(pool, volume))
Example #5
0
 def test_zfs_join_pool_volume_extra_slash(self):
     """ zfs._join_pool_volume removes extra slashes """
     pool = 'wark'
     volume = '//myvol/fs//foobar'
     self.assertEqual('wark/myvol/fs/foobar',
                      zfs._join_pool_volume(pool, volume))
Example #6
0
 def test_zfs_join_pool_volume(self):
     """ zfs._join_pool_volume combines poolname and volume """
     pool = 'mypool'
     volume = '/myvolume'
     self.assertEqual('mypool/myvolume',
                      zfs._join_pool_volume(pool, volume))