Exemplo n.º 1
0
 def test_parse_internal_profile(self):
     '''Ensure parsing internal profile option'''
     myargs = ["-n", "mysvc", "-p", "profile"]
     # for non-root users, expect SystemExit
     if os.getuid() != 0:
         self.assertRaises(SystemExit, validate_profile.parse_options,
                           myargs)
     else:
         options = validate_profile.parse_options(myargs)
         self.assertEquals(options.profile_name, ["profile"])
Exemplo n.º 2
0
    def test_parse_multi_options(self):
        '''Ensure multiple profiles processed'''

        # mask authorization verification function
        self.check_auth_and_euid = validate_profile.check_auth_and_euid
        validate_profile.check_auth_and_euid = do_nothing

        myargs = ["-n", "mysvc", "-p", "profile", "-p", "profile2"]
        options = validate_profile.parse_options(myargs)

        # restore authorization verification function
        validate_profile.check_auth_and_euid = self.check_auth_and_euid

        self.assertEquals(options.profile_name, ["profile", "profile2"])
Exemplo n.º 3
0
 def test_parse_multi_options(self):
     '''Ensure multiple profiles processed'''
     myargs = ["-n", "mysvc", "-p", "profile", "-p", "profile2"]
     options = validate_profile.parse_options(myargs)
     self.assertEquals(options.profile_name, ["profile", "profile2"])
 def test_parse_multi_options(self):
     '''Ensure multiple profiles processed'''
     myargs = ["-n", "mysvc", "-p", "profile", "-p", "profile2"] 
     options = validate_profile.parse_options(myargs)
     self.assertEquals(options.profile_name, ["profile", "profile2"])
Exemplo n.º 5
0
 def test_parse_external_profile(self):
     '''Ensure parsing external profile option'''
     myargs = ["-n", "mysvc", "-P", "profile.xml"]
     options = validate_profile.parse_options(myargs)
     self.assertEquals(options.profile_path, ["profile.xml"])