|
|
@@ -821,7 +821,7 @@ class TestAPI(OozieMockBase):
|
|
|
def test_autocomplete(self):
|
|
|
response = self.c.get(reverse('oozie:autocomplete_properties'))
|
|
|
test_response_json = response.content
|
|
|
- assert_true('mapred.input.dir' in test_response_json)
|
|
|
+ assert_true(b'mapred.input.dir' in test_response_json)
|
|
|
|
|
|
|
|
|
class TestApiPermissionsWithOozie(OozieBase):
|
|
|
@@ -1638,8 +1638,8 @@ class TestEditor(OozieMockBase):
|
|
|
coord = create_coordinator(self.wf, client_another_me, self.user)
|
|
|
|
|
|
response = client_another_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_true('Editor' in response.content, response.content)
|
|
|
- assert_true('Save coordinator' in response.content, response.content)
|
|
|
+ assert_true(b'Editor' in response.content, response.content)
|
|
|
+ assert_true(b'Save coordinator' in response.content, response.content)
|
|
|
|
|
|
# Check can schedule a non personal/shared workflow
|
|
|
workflow_select = '%s</option>' % self.wf
|
|
|
@@ -1907,8 +1907,8 @@ class TestEditor(OozieMockBase):
|
|
|
|
|
|
def test_workflow_data_binds(self):
|
|
|
response = self.c.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_equal(1, response.content.count('checked: is_shared'), response.content)
|
|
|
- assert_true('checked: capture_output' in response.content, response.content)
|
|
|
+ assert_equal(1, response.content.count(b'checked: is_shared'), response.content)
|
|
|
+ assert_true(b'checked: capture_output' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_xss_escape_js(self):
|
|
|
@@ -2172,14 +2172,14 @@ class TestEditorBundle(OozieMockBase):
|
|
|
}
|
|
|
|
|
|
response = self.c.get(reverse('oozie:create_bundled_coordinator', args=[bundle.id]))
|
|
|
- assert_true('Add coordinator' in response.content, response.content)
|
|
|
+ assert_true(b'Add coordinator' in response.content, response.content)
|
|
|
|
|
|
response = self.c.post(reverse('oozie:create_bundled_coordinator', args=[bundle.id]), post, follow=True)
|
|
|
- assert_true('This field is required' in response.content, response.content)
|
|
|
+ assert_true(b'This field is required' in response.content, response.content)
|
|
|
|
|
|
post['create-bundled-coordinator-coordinator'] = ['%s' % coord.id]
|
|
|
response = self.c.post(reverse('oozie:create_bundled_coordinator', args=[bundle.id]), post, follow=True)
|
|
|
- assert_true('Coordinators' in response.content, response.content)
|
|
|
+ assert_true(b'Coordinators' in response.content, response.content)
|
|
|
|
|
|
xml = bundle.to_xml({
|
|
|
'wf_%s_dir' % self.wf.id: '/deployment_path_wf',
|
|
|
@@ -2644,8 +2644,8 @@ class TestPermissions(OozieBase):
|
|
|
raise SkipTest
|
|
|
|
|
|
response = self.c.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_true('Editor' in response.content, response.content)
|
|
|
- assert_true('Save' in response.content, response.content)
|
|
|
+ assert_true(b'Editor' in response.content, response.content)
|
|
|
+ assert_true(b'Save' in response.content, response.content)
|
|
|
assert_false(self.wf.is_shared)
|
|
|
|
|
|
# Login as someone else
|
|
|
@@ -2656,13 +2656,13 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_workflows'))
|
|
|
- assert_false('wf-name-1' in response.content, response.content)
|
|
|
+ assert_false(b'wf-name-1' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_workflows'))
|
|
|
- assert_false('wf-name-1' in response.content, response.content)
|
|
|
+ assert_false(b'wf-name-1' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2670,14 +2670,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2692,7 +2692,7 @@ class TestPermissions(OozieBase):
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_workflows'))
|
|
|
assert_equal(200, response.status_code)
|
|
|
- assert_true('wf-name-1' in response.content, response.content)
|
|
|
+ assert_true(b'wf-name-1' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2700,14 +2700,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_workflow', args=[self.wf.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2715,7 +2715,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:submit_workflow', args=[self.wf.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2723,7 +2723,7 @@ class TestPermissions(OozieBase):
|
|
|
try:
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:submit_workflow', args=[self.wf.id]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
except IOError:
|
|
|
pass
|
|
|
finally:
|
|
|
@@ -2733,7 +2733,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:delete_workflow'), {'job_selection': [self.wf.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2755,7 +2755,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:restore_workflow'), {'job_selection': [self.wf.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2769,8 +2769,8 @@ class TestPermissions(OozieBase):
|
|
|
coord = create_coordinator(self.wf, self.c, self.user)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_true('Editor' in response.content, response.content)
|
|
|
- assert_true('Save coordinator' in response.content, response.content)
|
|
|
+ assert_true(b'Editor' in response.content, response.content)
|
|
|
+ assert_true(b'Save coordinator' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
|
|
|
@@ -2780,14 +2780,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_coordinators'))
|
|
|
- assert_false('MyCoord' in response.content, response.content)
|
|
|
+ assert_false(b'MyCoord' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_coordinators'))
|
|
|
- assert_false('MyCoord' in response.content, response.content)
|
|
|
+ assert_false(b'MyCoord' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2795,14 +2795,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_false('MyCoord' in response.content, response.content)
|
|
|
+ assert_false(b'MyCoord' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2831,7 +2831,7 @@ class TestPermissions(OozieBase):
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_coordinators'))
|
|
|
assert_equal(200, response.status_code)
|
|
|
- assert_true('MyCoord' in response.content, response.content)
|
|
|
+ assert_true(b'MyCoord' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2839,15 +2839,15 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
- assert_false('Save coordinator' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Save coordinator' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2855,8 +2855,8 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:edit_coordinator', args=[coord.id]))
|
|
|
- assert_false('MyCoord' in response.content, response.content)
|
|
|
- assert_true('Not allowed' in response.content, response.content)
|
|
|
+ assert_false(b'MyCoord' in response.content, response.content)
|
|
|
+ assert_true(b'Not allowed' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2864,7 +2864,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:submit_coordinator', args=[coord.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2872,7 +2872,7 @@ class TestPermissions(OozieBase):
|
|
|
try:
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:submit_coordinator', args=[coord.id]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
except IOError:
|
|
|
pass
|
|
|
finally:
|
|
|
@@ -2882,7 +2882,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:delete_coordinator'), {'job_selection': [coord.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2905,7 +2905,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:restore_coordinator'), {'job_selection': [coord.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2918,9 +2918,9 @@ class TestPermissions(OozieBase):
|
|
|
bundle = create_bundle(self.c, self.user)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:edit_bundle', args=[bundle.id]))
|
|
|
- assert_true('Editor' in response.content, response.content)
|
|
|
- assert_true('MyBundle' in response.content, response.content)
|
|
|
- assert_true('Save' in response.content, response.content)
|
|
|
+ assert_true(b'Editor' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle' in response.content, response.content)
|
|
|
+ assert_true(b'Save' in response.content, response.content)
|
|
|
assert_false(bundle.is_shared)
|
|
|
|
|
|
# Login as someone else
|
|
|
@@ -2931,13 +2931,13 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_bundles'))
|
|
|
- assert_false('MyBundle' in response.content, response.content)
|
|
|
+ assert_false(b'MyBundle' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_bundles'))
|
|
|
- assert_false('MyBundle' in response.content, response.content)
|
|
|
+ assert_false(b'MyBundle' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2945,14 +2945,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2965,7 +2965,7 @@ class TestPermissions(OozieBase):
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:list_bundles'))
|
|
|
assert_equal(200, response.status_code)
|
|
|
- assert_true('MyBundle' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2973,14 +2973,14 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(True)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.get(reverse('oozie:edit_bundle', args=[bundle.id]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -2990,7 +2990,7 @@ class TestPermissions(OozieBase):
|
|
|
response = client_not_me.post(reverse('oozie:submit_bundle', args=[bundle.id]),{
|
|
|
u'form-MAX_NUM_FORMS': [u''], u'form-INITIAL_FORMS': [u'0'], u'form-TOTAL_FORMS': [u'0']
|
|
|
})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -3000,7 +3000,7 @@ class TestPermissions(OozieBase):
|
|
|
response = client_not_me.post(reverse('oozie:submit_bundle', args=[bundle.id]), {
|
|
|
u'form-MAX_NUM_FORMS': [u''], u'form-INITIAL_FORMS': [u'0'], u'form-TOTAL_FORMS': [u'0']
|
|
|
})
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
except IOError:
|
|
|
pass
|
|
|
finally:
|
|
|
@@ -3010,7 +3010,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:delete_bundle'), {'job_selection': [bundle.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -3033,7 +3033,7 @@ class TestPermissions(OozieBase):
|
|
|
finish = SHARE_JOBS.set_for_testing(False)
|
|
|
try:
|
|
|
response = client_not_me.post(reverse('oozie:restore_bundle'), {'job_selection': [bundle.id]})
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -3212,15 +3212,15 @@ class TestOozieSubmissions(OozieBase):
|
|
|
raise SkipTest('HUE-2898: Skipping test until it can be debugged')
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_info'))
|
|
|
- assert_true('version' in response.content, response.content)
|
|
|
- assert_true('NORMAL' in response.content, response.content)
|
|
|
+ assert_true(b'version' in response.content, response.content)
|
|
|
+ assert_true(b'NORMAL' in response.content, response.content)
|
|
|
|
|
|
- assert_true('variables' in response.content, response.content)
|
|
|
- assert_true('timers' in response.content, response.content)
|
|
|
- assert_true('counters' in response.content, response.content)
|
|
|
+ assert_true(b'variables' in response.content, response.content)
|
|
|
+ assert_true(b'timers' in response.content, response.content)
|
|
|
+ assert_true(b'counters' in response.content, response.content)
|
|
|
|
|
|
- assert_true('ownMinTime' in response.content, response.content)
|
|
|
- assert_true('oozie.base.url' in response.content, response.content)
|
|
|
+ assert_true(b'ownMinTime' in response.content, response.content)
|
|
|
+ assert_true(b'oozie.base.url' in response.content, response.content)
|
|
|
|
|
|
def test_imported_workflow_submission(self):
|
|
|
# Workflow owned by "temp_user"
|
|
|
@@ -3301,7 +3301,7 @@ my_prop_not_filtered=10
|
|
|
u'form-2-value': [u'/path/output'],
|
|
|
}, follow=True)
|
|
|
|
|
|
- assert_true('oozie_workflow' in list(response.context[0]._data.keys()), response.content)
|
|
|
+ assert_true(b'oozie_workflow' in list(response.context[0]._data.keys()), response.content)
|
|
|
wf_id = response.context[0]._data['oozie_workflow'].id
|
|
|
|
|
|
# Check if response contains log data
|
|
|
@@ -3322,7 +3322,7 @@ my_prop_not_filtered=10
|
|
|
finish = OOZIE_URL.set_for_testing('http://not_localhost:11000/bad')
|
|
|
try:
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows'))
|
|
|
- assert_true('The Oozie server is not running' in response.content, response.content)
|
|
|
+ assert_true(b'The Oozie server is not running' in response.content, response.content)
|
|
|
finally:
|
|
|
finish()
|
|
|
|
|
|
@@ -3349,27 +3349,39 @@ class TestDashboard(OozieMockBase):
|
|
|
def test_manage_workflow_dashboard(self):
|
|
|
# Display of buttons happens in js now
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]), {}, follow=True)
|
|
|
- assert_true(('%s/kill' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('rerun_oozie_job/%s' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/suspend' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/resume' % MockOozieApi.WORKFLOW_IDS[0]) in response.content, response.content)
|
|
|
+ wf_id = MockOozieApi.WORKFLOW_IDS[0]
|
|
|
+ if not isinstance(wf_id, bytes):
|
|
|
+ wf_id = wf_id.encode('utf-8')
|
|
|
+ assert_true((b'%s/kill' % wf_id) in response.content, response.content)
|
|
|
+ assert_true((b'rerun_oozie_job/%s' % wf_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/suspend' % wf_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/resume' % wf_id) in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[1]]), {}, follow=True)
|
|
|
- assert_true(('%s/kill' % MockOozieApi.WORKFLOW_IDS[1]) in response.content, response.content)
|
|
|
- assert_true(('rerun_oozie_job/%s' % MockOozieApi.WORKFLOW_IDS[1]) in response.content, response.content)
|
|
|
+ wf_id = MockOozieApi.WORKFLOW_IDS[1]
|
|
|
+ if not isinstance(wf_id, bytes):
|
|
|
+ wf_id = wf_id.encode('utf-8')
|
|
|
+ assert_true((b'%s/kill' % wf_id) in response.content, response.content)
|
|
|
+ assert_true((b'rerun_oozie_job/%s' % wf_id) in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_manage_coordinator_dashboard(self):
|
|
|
# Display of buttons happens in js now
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]), {}, follow=True)
|
|
|
- assert_true(('%s/kill' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('rerun_oozie_coord/%s' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/suspend' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/resume' % MockOozieApi.COORDINATOR_IDS[0]) in response.content, response.content)
|
|
|
+ coor_id = MockOozieApi.COORDINATOR_IDS[0]
|
|
|
+ if not isinstance(coor_id, bytes):
|
|
|
+ coor_id = coor_id.encode('utf-8')
|
|
|
+ assert_true((b'%s/kill' % coor_id) in response.content, response.content)
|
|
|
+ assert_true((b'rerun_oozie_coord/%s' % coor_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/suspend' % coor_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/resume' % coor_id) in response.content, response.content)
|
|
|
|
|
|
# Test log filtering
|
|
|
url = reverse('oozie:get_oozie_job_log', args=[MockOozieApi.COORDINATOR_IDS[0]])
|
|
|
- assert_true(url in response.content, response.content)
|
|
|
+ url_bytes = url
|
|
|
+ if not isinstance(url_bytes, bytes):
|
|
|
+ url_bytes = url_bytes.encode('utf-8')
|
|
|
+ assert_true(url_bytes in response.content, response.content)
|
|
|
response = self.c.get(url + "?format=json&limit=100&loglevel=INFO&text=MapReduce")
|
|
|
data = json.loads(response.content)
|
|
|
assert_true(len(data['log'].split('\n')) <= 100)
|
|
|
@@ -3380,15 +3392,18 @@ class TestDashboard(OozieMockBase):
|
|
|
def test_manage_bundles_dashboard(self):
|
|
|
# Display of buttons happens in js now
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]), {}, follow=True)
|
|
|
- assert_true(('%s/kill' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('rerun_oozie_bundle/%s' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/suspend' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
|
|
|
- assert_true(('%s/resume' % MockOozieApi.BUNDLE_IDS[0]) in response.content, response.content)
|
|
|
+ bndl_id = MockOozieApi.BUNDLE_IDS[0]
|
|
|
+ if not isinstance(bndl_id, bytes):
|
|
|
+ bndl_id = bndl_id.encode('utf-8')
|
|
|
+ assert_true((b'%s/kill' % bndl_id) in response.content, response.content)
|
|
|
+ assert_true((b'rerun_oozie_bundle/%s' % bndl_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/suspend' % bndl_id) in response.content, response.content)
|
|
|
+ assert_true((b'%s/resume' % bndl_id) in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_rerun_coordinator(self):
|
|
|
response = self.c.get(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.WORKFLOW_IDS[0], '/path']))
|
|
|
- assert_true('Rerun' in response.content, response.content)
|
|
|
+ assert_true(b'Rerun' in response.content, response.content)
|
|
|
|
|
|
def test_sync_coord_workflow(self):
|
|
|
wf_doc = save_temp_workflow(MockOozieApi.JSON_WORKFLOW_LIST[5], self.user)
|
|
|
@@ -3411,19 +3426,19 @@ class TestDashboard(OozieMockBase):
|
|
|
}
|
|
|
|
|
|
response = self.c.post(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.COORDINATOR_IDS[0], '/path']), post_data)
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
|
|
|
grant_access("not_me", "test", "oozie")
|
|
|
|
|
|
response = client_not_me.post(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.COORDINATOR_IDS[0], '/path']), post_data)
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_rerun_bundle(self):
|
|
|
response = self.c.get(reverse('oozie:rerun_oozie_coord', args=[MockOozieApi.WORKFLOW_IDS[0], '/path']))
|
|
|
- assert_true('Rerun' in response.content, response.content)
|
|
|
+ assert_true(b'Rerun' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_rerun_bundle_permissions(self):
|
|
|
@@ -3448,118 +3463,132 @@ class TestDashboard(OozieMockBase):
|
|
|
}
|
|
|
|
|
|
response = self.c.post(reverse('oozie:rerun_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0], '/path']), post_data)
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test')
|
|
|
grant_access("not_me", "test", "oozie")
|
|
|
|
|
|
response = client_not_me.post(reverse('oozie:rerun_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0], '/path']), post_data)
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_workflows(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows'))
|
|
|
- assert_true('Running' in response.content, response.content)
|
|
|
- assert_true('Completed' in response.content, response.content)
|
|
|
+ assert_true(b'Running' in response.content, response.content)
|
|
|
+ assert_true(b'Completed' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json")
|
|
|
assert_true(len(json.loads(response.content)['jobs']) == 0)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=RUNNING&status=PREP&status=SUSPENDED")
|
|
|
for wf_id in MockOozieApi.WORKFLOW_IDS:
|
|
|
+ if not isinstance(wf_id, bytes):
|
|
|
+ wf_id = wf_id.encode('utf-8')
|
|
|
assert_true(wf_id in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows') + "?format=json&status=KILLED&status=FAILED")
|
|
|
for wf_id in MockOozieApi.WORKFLOW_IDS:
|
|
|
+ if not isinstance(wf_id, bytes):
|
|
|
+ wf_id = wf_id.encode('utf-8')
|
|
|
assert_true(wf_id in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_coordinators(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinators'))
|
|
|
- assert_true('Running' in response.content, response.content)
|
|
|
- assert_true('Completed' in response.content, response.content)
|
|
|
+ assert_true(b'Running' in response.content, response.content)
|
|
|
+ assert_true(b'Completed' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json")
|
|
|
assert_true(len(json.loads(response.content)['jobs']) == 0)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json&status=RUNNING&status=PREP&status=SUSPENDED")
|
|
|
for coord_id in MockOozieApi.COORDINATOR_IDS:
|
|
|
+ if not isinstance(coord_id, bytes):
|
|
|
+ coord_id = coord_id.encode('utf-8')
|
|
|
assert_true(coord_id in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinators') + "?format=json&status=KILLED&status=FAILED&status=DONEWITHERROR")
|
|
|
for coord_id in MockOozieApi.COORDINATOR_IDS:
|
|
|
+ if not isinstance(coord_id, bytes):
|
|
|
+ coord_id = coord_id.encode('utf-8')
|
|
|
assert_true(coord_id in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_bundles(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundles'))
|
|
|
- assert_true('Running' in response.content, response.content)
|
|
|
- assert_true('Completed' in response.content, response.content)
|
|
|
+ assert_true(b'Running' in response.content, response.content)
|
|
|
+ assert_true(b'Completed' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=RUNNING")
|
|
|
for coord_id in MockOozieApi.BUNDLE_IDS:
|
|
|
+ if not isinstance(coord_id, bytes):
|
|
|
+ coord_id = coord_id.encode('utf-8')
|
|
|
assert_true(coord_id in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=SUCCEEDED")
|
|
|
for coord_id in MockOozieApi.BUNDLE_IDS:
|
|
|
+ if not isinstance(coord_id, bytes):
|
|
|
+ coord_id = coord_id.encode('utf-8')
|
|
|
assert_true(coord_id in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=KILLED")
|
|
|
for coord_id in MockOozieApi.BUNDLE_IDS:
|
|
|
+ if not isinstance(coord_id, bytes):
|
|
|
+ coord_id = coord_id.encode('utf-8')
|
|
|
assert_true(coord_id in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_workflow(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
|
|
|
- assert_true('Workflow WordCount1' in response.content, response.content)
|
|
|
- assert_true('Workflow' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow WordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]) + '?coordinator_job_id=%s' % MockOozieApi.COORDINATOR_IDS[0])
|
|
|
- assert_true('Workflow WordCount1' in response.content, response.content)
|
|
|
- assert_true('Workflow' in response.content, response.content)
|
|
|
- assert_true('DailyWordCount1' in response.content, response.content)
|
|
|
- assert_true('Coordinator' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow WordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow' in response.content, response.content)
|
|
|
+ assert_true(b'DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'Coordinator' in response.content, response.content)
|
|
|
|
|
|
# Test for unicode character '�' rendering
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[6]]))
|
|
|
- assert_false('UnicodeEncodeError' in response.content, response.content)
|
|
|
- assert_true('TestUnicodeParam' in response.content, response.content)
|
|
|
+ assert_false(b'UnicodeEncodeError' in response.content, response.content)
|
|
|
+ assert_true(b'TestUnicodeParam' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_workflow_action(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
|
|
|
- assert_true('Action WordCount' in response.content, response.content)
|
|
|
- assert_true('job_201302280955_0018' in response.content, response.content)
|
|
|
- assert_true('job_201302280955_0019' in response.content, response.content)
|
|
|
- assert_true('job_201302280955_0020' in response.content, response.content)
|
|
|
+ assert_true(b'Action WordCount' in response.content, response.content)
|
|
|
+ assert_true(b'job_201302280955_0018' in response.content, response.content)
|
|
|
+ assert_true(b'job_201302280955_0019' in response.content, response.content)
|
|
|
+ assert_true(b'job_201302280955_0020' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']) + '?coordinator_job_id=%s&bundle_job_id=%s' % (MockOozieApi.COORDINATOR_IDS[0], MockOozieApi.BUNDLE_IDS[0]))
|
|
|
- assert_true('Bundle' in response.content, response.content)
|
|
|
- assert_true('MyBundle1' in response.content, response.content)
|
|
|
- assert_true('Coordinator' in response.content, response.content)
|
|
|
- assert_true('DailyWordCount1' in response.content, response.content)
|
|
|
- assert_true('Workflow' in response.content, response.content)
|
|
|
- assert_true('WordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'Bundle' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle1' in response.content, response.content)
|
|
|
+ assert_true(b'Coordinator' in response.content, response.content)
|
|
|
+ assert_true(b'DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow' in response.content, response.content)
|
|
|
+ assert_true(b'WordCount1' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_coordinator(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[4]]))
|
|
|
assert_true(u'Coordinator DåilyWordCount5' in response.content.decode('utf-8', 'replace'), response.content.decode('utf-8', 'replace'))
|
|
|
- assert_true('Workflow' in response.content, response.content)
|
|
|
+ assert_true(b'Workflow' in response.content, response.content)
|
|
|
|
|
|
# Test action list
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[5]]) + "?format=json&offset=1")
|
|
|
- assert_true('00000013-120706144403213-oozie-oozi-C@1' in response.content, response.content)
|
|
|
- assert_true('00000013-120706144403213-oozie-oozi-C@2' in response.content, response.content)
|
|
|
- assert_true('00000013-120706144403213-oozie-oozi-C@3' in response.content, response.content)
|
|
|
- assert_true('00000013-120706144403213-oozie-oozi-C@4' in response.content, response.content)
|
|
|
+ assert_true(b'00000013-120706144403213-oozie-oozi-C@1' in response.content, response.content)
|
|
|
+ assert_true(b'00000013-120706144403213-oozie-oozi-C@2' in response.content, response.content)
|
|
|
+ assert_true(b'00000013-120706144403213-oozie-oozi-C@3' in response.content, response.content)
|
|
|
+ assert_true(b'00000013-120706144403213-oozie-oozi-C@4' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_list_bundle(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
|
|
|
- assert_true('Bundle MyBundle1' in response.content, response.content)
|
|
|
- assert_true('Coordinators' in response.content, response.content)
|
|
|
+ assert_true(b'Bundle MyBundle1' in response.content, response.content)
|
|
|
+ assert_true(b'Coordinators' in response.content, response.content)
|
|
|
|
|
|
def test_workflow_timezones(self):
|
|
|
job = MockOozieApi.get_job(MockOozieApi(), '0000007-120725142744176-oozie-oozi-W')
|
|
|
@@ -3598,133 +3627,133 @@ class TestDashboard(OozieMockBase):
|
|
|
|
|
|
def test_workflows_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflows') + '?format=json&status=SUCCEEDED')
|
|
|
- assert_true('WordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'WordCount1' in response.content, response.content)
|
|
|
|
|
|
# Rerun
|
|
|
response = self.c.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
|
|
|
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
|
|
|
- assert_false('Permission denied.' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied.' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_workflows') + '?format=json&status=SUCCEEDED')
|
|
|
- assert_false('WordCount1' in response.content, response.content)
|
|
|
+ assert_false(b'WordCount1' in response.content, response.content)
|
|
|
|
|
|
# Rerun
|
|
|
response = client_not_me.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
|
|
|
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
|
|
|
- assert_true('Permission denied.' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied.' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_workflows')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_true('WordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'WordCount1' in response.content, response.content)
|
|
|
|
|
|
# Rerun
|
|
|
response = client_not_me.get(reverse('oozie:rerun_oozie_job', kwargs={'job_id': MockOozieApi.WORKFLOW_IDS[0],
|
|
|
'app_path': MockOozieApi.JSON_WORKFLOW_LIST[0]['appPath']}))
|
|
|
- assert_true('Permission denied.' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied.' in response.content, response.content)
|
|
|
|
|
|
def test_workflow_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
|
|
|
- assert_true('WordCount1' in response.content, response.content)
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'WordCount1' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_workflow_action', args=['XXX']))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_workflow', args=[MockOozieApi.WORKFLOW_IDS[0]]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_coordinators_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_true('DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'DailyWordCount1' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_false('DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_false(b'DailyWordCount1' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_coordinators')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_true('DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_true(b'DailyWordCount1' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_coordinator_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
|
|
|
- assert_true('DailyWordCount1' in response.content, response.content)
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'DailyWordCount1' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_coordinator', args=[MockOozieApi.COORDINATOR_IDS[0]]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_bundles_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundles') + "?format=json&status=SUCCEEDED")
|
|
|
- assert_true('MyBundle1' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle1' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_bundles')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_false('MyBundle1' in response.content, response.content)
|
|
|
+ assert_false(b'MyBundle1' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_bundles')+"?format=json&status=SUCCEEDED")
|
|
|
- assert_true('MyBundle1' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle1' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_bundle_permissions(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
|
|
|
- assert_true('MyBundle1' in response.content, response.content)
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'MyBundle1' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Login as someone else
|
|
|
client_not_me = make_logged_in_client(username='not_me', is_superuser=False, groupname='test', recreate=True)
|
|
|
grant_access("not_me", "not_me", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
|
|
|
- assert_true('Permission denied' in response.content, response.content)
|
|
|
+ assert_true(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
# Add read only access
|
|
|
add_permission("not_me", "dashboard_jobs_access", "dashboard_jobs_access", "oozie")
|
|
|
|
|
|
response = client_not_me.get(reverse('oozie:list_oozie_bundle', args=[MockOozieApi.BUNDLE_IDS[0]]))
|
|
|
- assert_false('Permission denied' in response.content, response.content)
|
|
|
+ assert_false(b'Permission denied' in response.content, response.content)
|
|
|
|
|
|
|
|
|
def test_good_workflow_status_graph(self):
|
|
|
@@ -3754,7 +3783,7 @@ class TestDashboard(OozieMockBase):
|
|
|
|
|
|
def test_list_oozie_sla(self):
|
|
|
response = self.c.get(reverse('oozie:list_oozie_sla'))
|
|
|
- assert_true('Oozie Dashboard' in response.content, response.content)
|
|
|
+ assert_true(b'Oozie Dashboard' in response.content, response.content)
|
|
|
|
|
|
response = self.c.get(reverse('oozie:list_oozie_sla') + "?format=json")
|
|
|
for sla in MockOozieApi.WORKFLOWS_SLAS:
|
|
|
@@ -3762,7 +3791,7 @@ class TestDashboard(OozieMockBase):
|
|
|
|
|
|
response = self.c.post(reverse('oozie:list_oozie_sla') + "?format=json", {'job_name': 'kochang'})
|
|
|
for sla in MockOozieApi.WORKFLOWS_SLAS:
|
|
|
- assert_true('MISS' in response.content, response.content)
|
|
|
+ assert_true(b'MISS' in response.content, response.content)
|
|
|
|
|
|
|
|
|
class GeneralTestsWithOozie(OozieBase):
|