import os
import unittest

import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest

class TestSetupVomsAdmin(osgunittest.OSGTestCase):

    def test_01_wait_for_voms_admin(self):
        core.state['voms.started-webapp'] = False

        core.skip_ok_unless_installed('voms-admin-server')

        line, gap = core.monitor_file(core.config['voms.webapp-log'],
                                      core.state['voms.webapp-log-stat'],
                                      'VOMS-Admin started succesfully', 60.0)
        self.assert_(line is not None, 'VOMS Admin webapp started')
        core.state['voms.started-webapp'] = True
        core.log_message('VOMS Admin started after %.1f seconds' % gap)

    def test_02_open_access(self):
        core.skip_ok_unless_installed('voms-admin-server', 'voms-admin-client')
        self.skip_ok_unless(core.state['voms.started-webapp'], 'VOMS Admin webapp not started')

        command = ('voms-admin', '--nousercert',
                   '--vo', core.config['voms.vo'],
                   'add-ACL-entry', '/' + core.config['voms.vo'], 'ANYONE',
                   'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
        core.check_system(command, 'Add VOMS Admin ACL entry')

import os
import unittest

import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest

class TestSetupVomsAdmin(osgunittest.OSGTestCase):

    def test_01_wait_for_voms_admin(self):
        core.state['voms.started-webapp'] = False

        core.skip_ok_unless_installed('voms-admin-server')

        line, gap = core.monitor_file(core.config['voms.webapp-log'], core.state['voms.webapp-log-stat'],
                                      'VOMS-Admin started succesfully', 120.0)
        self.assert_(line is not None, 'VOMS Admin webapp started')
        core.state['voms.started-webapp'] = True
        core.log_message('VOMS Admin started after %.1f seconds' % gap)

    def test_02_open_access(self):
        core.skip_ok_unless_installed('voms-admin-server', 'voms-admin-client')
        self.skip_ok_unless(core.state['voms.started-webapp'], 'VOMS Admin webapp not started')

        command = ('voms-admin', '--nousercert', '--vo', core.config['voms.vo'], 'add-ACL-entry',
                   '/' + core.config['voms.vo'], 'ANYONE', 'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
        core.check_system(command, 'Add VOMS Admin ACL entry')

Increase the timeout value for the VOMS Admin start-up from 60s to 120s. Primarily, this is driven by occasional timeouts in the VMU tests, which can run slowly on a heavily loaded host.
Increase the timeout value for the VOMS Admin start-up from 60s to 120s.
Primarily, this is driven by occasional timeouts in the VMU tests, which
can run slowly on a heavily loaded host.


git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@18485 4e558342-562e-0410-864c-e07659590f8c

  import os
  import unittest
  
  import osgtest.library.core as core
  import osgtest.library.osgunittest as osgunittest
  
  class TestSetupVomsAdmin(osgunittest.OSGTestCase):
  
      def test_01_wait_for_voms_admin(self):
          core.state['voms.started-webapp'] = False
  
          core.skip_ok_unless_installed('voms-admin-server')
  
-         line, gap = core.monitor_file(core.config['voms.webapp-log'],
+         line, gap = core.monitor_file(core.config['voms.webapp-log'], core.state['voms.webapp-log-stat'],
-                                       core.state['voms.webapp-log-stat'],
-                                       'VOMS-Admin started succesfully', 60.0)
+                                       'VOMS-Admin started succesfully', 120.0)
          self.assert_(line is not None, 'VOMS Admin webapp started')
          core.state['voms.started-webapp'] = True
          core.log_message('VOMS Admin started after %.1f seconds' % gap)
  
      def test_02_open_access(self):
          core.skip_ok_unless_installed('voms-admin-server', 'voms-admin-client')
          self.skip_ok_unless(core.state['voms.started-webapp'], 'VOMS Admin webapp not started')
  
+         command = ('voms-admin', '--nousercert', '--vo', core.config['voms.vo'], 'add-ACL-entry',
-         command = ('voms-admin', '--nousercert',
-                    '--vo', core.config['voms.vo'],
-                    'add-ACL-entry', '/' + core.config['voms.vo'], 'ANYONE',
-                    'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
+                    '/' + core.config['voms.vo'], 'ANYONE', 'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
          core.check_system(command, 'Add VOMS Admin ACL entry')
  
Increase the timeout value for the VOMS Admin start-up from 60s to 120s. Primarily, this is driven by occasional timeouts in the VMU tests, which can run slowly on a heavily loaded host.
## Code Before:
import os
import unittest

import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest

class TestSetupVomsAdmin(osgunittest.OSGTestCase):

    def test_01_wait_for_voms_admin(self):
        core.state['voms.started-webapp'] = False

        core.skip_ok_unless_installed('voms-admin-server')

        line, gap = core.monitor_file(core.config['voms.webapp-log'],
                                      core.state['voms.webapp-log-stat'],
                                      'VOMS-Admin started succesfully', 60.0)
        self.assert_(line is not None, 'VOMS Admin webapp started')
        core.state['voms.started-webapp'] = True
        core.log_message('VOMS Admin started after %.1f seconds' % gap)

    def test_02_open_access(self):
        core.skip_ok_unless_installed('voms-admin-server', 'voms-admin-client')
        self.skip_ok_unless(core.state['voms.started-webapp'], 'VOMS Admin webapp not started')

        command = ('voms-admin', '--nousercert',
                   '--vo', core.config['voms.vo'],
                   'add-ACL-entry', '/' + core.config['voms.vo'], 'ANYONE',
                   'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
        core.check_system(command, 'Add VOMS Admin ACL entry')

## Instruction:
Increase the timeout value for the VOMS Admin start-up from 60s to 120s. Primarily, this is driven by occasional timeouts in the VMU tests, which can run slowly on a heavily loaded host.
## Code After:
import os
import unittest

import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest

class TestSetupVomsAdmin(osgunittest.OSGTestCase):

    def test_01_wait_for_voms_admin(self):
        core.state['voms.started-webapp'] = False

        core.skip_ok_unless_installed('voms-admin-server')

        line, gap = core.monitor_file(core.config['voms.webapp-log'], core.state['voms.webapp-log-stat'],
                                      'VOMS-Admin started succesfully', 120.0)
        self.assert_(line is not None, 'VOMS Admin webapp started')
        core.state['voms.started-webapp'] = True
        core.log_message('VOMS Admin started after %.1f seconds' % gap)

    def test_02_open_access(self):
        core.skip_ok_unless_installed('voms-admin-server', 'voms-admin-client')
        self.skip_ok_unless(core.state['voms.started-webapp'], 'VOMS Admin webapp not started')

        command = ('voms-admin', '--nousercert', '--vo', core.config['voms.vo'], 'add-ACL-entry',
                   '/' + core.config['voms.vo'], 'ANYONE', 'VOMS_CA', 'CONTAINER_READ,MEMBERSHIP_READ', 'true')
        core.check_system(command, 'Add VOMS Admin ACL entry')
