Пример #1
0
    def test01_vsmUserExistence(self):
        '''! Verifies if "vasum" user with an appropriate UID exists within the
             zones.
        '''
        for zoneName, zonePath in self.configChecker.zones.iteritems():
            # chroot into a zone and get UID of the user
            output, ret = vsm_test_utils.launchProc("chroot " + zonePath +
                                                   " /usr/bin/id -u " + VSM_USER_NAME)

            self.assertEqual(ret, 0, "User '" + VSM_USER_NAME + "' does not exist in '" +
                             zoneName + "' zone.")

            # cast to integer to remove white spaces, etc.
            uid = int(output)
            self.assertEqual(uid, VSM_UID, "Invalid UID of '" + VSM_USER_NAME + "' in '" +
                             zoneName + "' zone: got " + str(uid) +
                             ", should be " + str(VSM_UID))
Пример #2
0
def runCommand(cmd, blockDebug=False):
    null_device_str = OUTPUT_TO_NULL_DEVICE
    if(DEBUG_COMMAND):
        null_device_str = ""

    run_cmd = "( " + cmd + " ) " + null_device_str

    rc=0
    try:
        out=vsm_test_utils.launchProc(run_cmd)
        rc=out[0]
    except Exception:
        traceback.print_exc()
        rc=1

    if(DEBUG_COMMAND and not blockDebug):
        LOG_DEBUG("[DEBUG CMD] RC = " + str(rc) + "; CMD = " + run_cmd)

    return rc
Пример #3
0
def runCommand(cmd, blockDebug=False):
    null_device_str = OUTPUT_TO_NULL_DEVICE
    if (DEBUG_COMMAND):
        null_device_str = ""

    run_cmd = "( " + cmd + " ) " + null_device_str

    rc = 0
    try:
        out = vsm_test_utils.launchProc(run_cmd)
        rc = out[0]
    except Exception:
        traceback.print_exc()
        rc = 1

    if (DEBUG_COMMAND and not blockDebug):
        LOG_DEBUG("[DEBUG CMD] RC = " + str(rc) + "; CMD = " + run_cmd)

    return rc
Пример #4
0
    def test01_vsmUserExistence(self):
        '''! Verifies if "vasum" user with an appropriate UID exists within the
             zones.
        '''
        for zoneName, zonePath in self.configChecker.zones.iteritems():
            # chroot into a zone and get UID of the user
            output, ret = vsm_test_utils.launchProc("chroot " + zonePath +
                                                    " /usr/bin/id -u " +
                                                    VSM_USER_NAME)

            self.assertEqual(
                ret, 0, "User '" + VSM_USER_NAME + "' does not exist in '" +
                zoneName + "' zone.")

            # cast to integer to remove white spaces, etc.
            uid = int(output)
            self.assertEqual(
                uid, VSM_UID,
                "Invalid UID of '" + VSM_USER_NAME + "' in '" + zoneName +
                "' zone: got " + str(uid) + ", should be " + str(VSM_UID))