

def test_resize2fs_e2fsck_fails(self):
    imgfile = tempfile.NamedTemporaryFile()
    self.addCleanup(imgfile.close)
    self.mox.StubOutWithMock(utils, 'execute')
    utils.execute('e2fsck', '-fp', imgfile, check_exit_code=[0, 1, 2], run_as_root=False).AndRaise(processutils.ProcessExecutionError('fs error'))
    self.mox.ReplayAll()
    api.resize2fs(imgfile)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/disk/test_api.py APITestCase.test_resize2fs_e2fsck_fails/original