def test_confirm_path_gid_nobody(self, mock_lstat): uid_ranges = [(1000, 1999)] gid_ranges = [(300, 399)] mock_lstat.return_value = FakeStat(1000, 50000) result = idmapshift.confirm_path('/test/path', uid_ranges, gid_ranges, 50000) mock_lstat.assert_has_calls(mock.call('/test/path')) self.assertTrue(result)
def test_confirm_path_uid_mismatch(self, mock_lstat): uid_ranges = [(1000, 1999)] gid_ranges = [(300, 399)] mock_lstat.return_value = FakeStat(0, 301) result = idmapshift.confirm_path('/test/path', uid_ranges, gid_ranges, 50000) mock_lstat.assert_has_calls(mock.call('/test/path')) self.assertFalse(result)