コード例 #1
0
    def setUp(self):
        OozieServerProvider.setup_class()
        self.cluster.fs.do_as_user('jobsub_test',
                                   self.cluster.fs.create_home_dir,
                                   '/user/jobsub_test')
        self.cluster.fs.do_as_superuser(self.cluster.fs.chmod,
                                        '/user/jobsub_test', 0o777,
                                        True)  # Hum?
        self.client = make_logged_in_client(username='******')
        self.user = User.objects.get(username='******')

        # Ensure access to MR folder.
        # Need to chmod because jobs are submitted as a
        # different user than what was previously used.
        for i in range(0, 10):
            try:
                self.cluster.fs.do_as_superuser(self.cluster.fs.chmod,
                                                '/tmp',
                                                0o777,
                                                recursive=True)
                break
            except Exception as e:
                # chmod failure likely do to async processing of resource deletion.
                # If the directory has improper permissions, should fail later in the test case.
                LOG.warning(
                    "Received the following exception while change mode attempt %d of /tmp: %s"
                    % (i, str(e)))
                time.sleep(1)

        self.design = self.create_design()
コード例 #2
0
ファイル: tests.py プロジェクト: guoqinga/hue
  def setup_class(cls):
    OozieServerProvider.setup_class()

    cls.username = '******'
    cls.home_dir = '/user/%s' % cls.username
    cls.cluster.fs.do_as_user(cls.username, cls.cluster.fs.create_home_dir, cls.home_dir)

    cls.client = make_logged_in_client(username=cls.username, is_superuser=False, groupname='test')
    cls.user = User.objects.get(username=cls.username)
    grant_access(cls.username, 'test', 'jobsub')
    grant_access(cls.username, 'test', 'jobbrowser')
    grant_access(cls.username, 'test', 'oozie')
    add_to_group(cls.username)

    cls.prev_user = cls.cluster.fs.user
    cls.cluster.fs.setuser(cls.username)

    cls.install_examples()
    cls.design = cls.create_design()

    # Run the sleep example, since it doesn't require user home directory
    design_id = cls.design.id
    response = cls.client.post(reverse('oozie:submit_workflow',
                                args=[design_id]),
                                data={u'form-MAX_NUM_FORMS': [u''],
                                      u'form-INITIAL_FORMS': [u'1'],
                                      u'form-0-name': [u'REDUCER_SLEEP_TIME'],
                                      u'form-0-value': [u'1'],
                                      u'form-TOTAL_FORMS': [u'1']},
                                follow=True)
    oozie_jobid = response.context['oozie_workflow'].id
    OozieServerProvider.wait_until_completion(oozie_jobid)

    cls.hadoop_job_id = get_hadoop_job_id(cls.oozie, oozie_jobid, 1)
    cls.hadoop_job_id_short = views.get_shorter_id(cls.hadoop_job_id)
コード例 #3
0
ファイル: tests.py プロジェクト: xenonstack/hue
  def setup_class(cls):
    OozieServerProvider.setup_class()

    cls.username = '******'
    cls.home_dir = '/user/%s' % cls.username
    cls.cluster.fs.do_as_user(cls.username, cls.cluster.fs.create_home_dir, cls.home_dir)

    cls.client = make_logged_in_client(username=cls.username, is_superuser=False, groupname='test')
    cls.user = User.objects.get(username=cls.username)
    grant_access(cls.username, 'test', 'jobsub')
    grant_access(cls.username, 'test', 'jobbrowser')
    grant_access(cls.username, 'test', 'oozie')
    add_to_group(cls.username)

    cls.prev_user = cls.cluster.fs.user
    cls.cluster.fs.setuser(cls.username)

    cls.install_examples()
    cls.design = cls.create_design()

    # Run the sleep example, since it doesn't require user home directory
    design_id = cls.design.id
    response = cls.client.post(reverse('oozie:submit_workflow',
                                args=[design_id]),
                                data={u'form-MAX_NUM_FORMS': [u''],
                                      u'form-INITIAL_FORMS': [u'1'],
                                      u'form-0-name': [u'REDUCER_SLEEP_TIME'],
                                      u'form-0-value': [u'1'],
                                      u'form-TOTAL_FORMS': [u'1']},
                                follow=True)
    oozie_jobid = response.context['oozie_workflow'].id
    OozieServerProvider.wait_until_completion(oozie_jobid)

    cls.hadoop_job_id = get_hadoop_job_id(cls.oozie, oozie_jobid, 1)
    cls.hadoop_job_id_short = views.get_shorter_id(cls.hadoop_job_id)
コード例 #4
0
ファイル: tests.py プロジェクト: cloudera/hue
  def setUp(self):
    OozieServerProvider.setup_class()
    self.cluster.fs.do_as_user('jobsub_test', self.cluster.fs.create_home_dir, '/user/jobsub_test')
    self.cluster.fs.do_as_superuser(self.cluster.fs.chmod, '/user/jobsub_test', 0777, True) # Hum?
    self.client = make_logged_in_client(username='******')
    self.user = User.objects.get(username='******')

    # Ensure access to MR folder.
    # Need to chmod because jobs are submitted as a
    # different user than what was previously used.
    for i in range(0,10):
      try:
        self.cluster.fs.do_as_superuser(self.cluster.fs.chmod, '/tmp', 0777, recursive=True)
        break
      except Exception, e:
        # chmod failure likely do to async processing of resource deletion.
        # If the directory has improper permissions, should fail later in the test case.
        LOG.warn("Received the following exception while change mode attempt %d of /tmp: %s" % (i, str(e)))
        time.sleep(1)
コード例 #5
0
ファイル: tests.py プロジェクト: GorillaTester/hue
    def setup_class(cls):
        OozieServerProvider.setup_class()

        cls.username = "******"
        cls.home_dir = "/user/%s" % cls.username
        cls.cluster.fs.do_as_user(cls.username, cls.cluster.fs.create_home_dir, cls.home_dir)

        cls.client = make_logged_in_client(username=cls.username, is_superuser=False, groupname="test")
        cls.user = User.objects.get(username=cls.username)
        grant_access(cls.username, "test", "jobsub")
        grant_access(cls.username, "test", "jobbrowser")
        grant_access(cls.username, "test", "oozie")
        add_to_group(cls.username)

        cls.prev_user = cls.cluster.fs.user
        cls.cluster.fs.setuser(cls.username)

        cls.install_examples()
        cls.design = cls.create_design()

        # Run the sleep example, since it doesn't require user home directory
        design_id = cls.design.id
        response = cls.client.post(
            reverse("oozie:submit_workflow", args=[design_id]),
            data={
                u"form-MAX_NUM_FORMS": [u""],
                u"form-INITIAL_FORMS": [u"1"],
                u"form-0-name": [u"REDUCER_SLEEP_TIME"],
                u"form-0-value": [u"1"],
                u"form-TOTAL_FORMS": [u"1"],
            },
            follow=True,
        )
        oozie_jobid = response.context["oozie_workflow"].id
        OozieServerProvider.wait_until_completion(oozie_jobid)

        cls.hadoop_job_id = get_hadoop_job_id(cls.oozie, oozie_jobid, 1)
        cls.hadoop_job_id_short = views.get_shorter_id(cls.hadoop_job_id)
コード例 #6
0
ファイル: tests.py プロジェクト: 15580056814/hue
 def setup_class(cls):
   OozieServerProvider.setup_class()
コード例 #7
0
 def setup_class(cls):
     OozieServerProvider.setup_class()