import os
import pwd
import unittest

import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest

class TestGUMS(osgunittest.OSGTestCase):

    def test_01_map_user(self):
        core.skip_ok_unless_installed('gums-service')

        host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
        pwd_entry = pwd.getpwnam(core.options.username)
        cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
        user_dn, _ = core.certificate_info(cert_path)
        command = ('gums-host', 'mapUser', user_dn)
        core.check_system(command, 'Map GUMS user')

import os
import pwd
import unittest

import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest

class TestGUMS(osgunittest.OSGTestCase):

    def test_01_map_user(self):
        core.skip_ok_unless_installed('gums-service')

        host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
        pwd_entry = pwd.getpwnam(core.options.username)
        cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
        user_dn, _ = core.certificate_info(cert_path)
        command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
        core.check_system(command, 'Map GUMS user')

Revert accidental gums test change from previous commit.
Revert accidental gums test change from previous commit.

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

  import os
  import pwd
  import unittest
  
  import osgtest.library.core as core
  import osgtest.library.files as files
  import osgtest.library.tomcat as tomcat
  import osgtest.library.osgunittest as osgunittest
  
  class TestGUMS(osgunittest.OSGTestCase):
  
      def test_01_map_user(self):
          core.skip_ok_unless_installed('gums-service')
  
          host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
          pwd_entry = pwd.getpwnam(core.options.username)
          cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
          user_dn, _ = core.certificate_info(cert_path)
-         command = ('gums-host', 'mapUser', user_dn)
+         command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
          core.check_system(command, 'Map GUMS user')
  
Revert accidental gums test change from previous commit.
## Code Before:
import os
import pwd
import unittest

import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest

class TestGUMS(osgunittest.OSGTestCase):

    def test_01_map_user(self):
        core.skip_ok_unless_installed('gums-service')

        host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
        pwd_entry = pwd.getpwnam(core.options.username)
        cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
        user_dn, _ = core.certificate_info(cert_path)
        command = ('gums-host', 'mapUser', user_dn)
        core.check_system(command, 'Map GUMS user')

## Instruction:
Revert accidental gums test change from previous commit.
## Code After:
import os
import pwd
import unittest

import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest

class TestGUMS(osgunittest.OSGTestCase):

    def test_01_map_user(self):
        core.skip_ok_unless_installed('gums-service')

        host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
        pwd_entry = pwd.getpwnam(core.options.username)
        cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
        user_dn, _ = core.certificate_info(cert_path)
        command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
        core.check_system(command, 'Map GUMS user')
