!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/bin/X11/./../../lib/evolution-openldap/../python2.4/site-packages/Ft/Lib/CommandLine/   drwxr-xr-x
Free 5.03 GB of 27.03 GB (18.61%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     CommandLineTestUtil.py (4.26 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Lib/CommandLine/CommandLineTestUtil.py,v 1.16 2005/04/13 23:41:04 jkloth Exp $
"""
Command-line script related extensions to the test suite framework

Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

import os

import Ft

class TestRun:

    def __init__(self, name, options, args, expectedOut=None,
                 validationFunc=None, input=None, outFile=None,
                 skipOutputTest=False, compareFunc=cmp):
        self.name = name
        self.expectedOut = expectedOut
        self.validationFunc = validationFunc
        self.input = input
        self.output = outFile
        self.skipOutputTest = skipOutputTest
        self.compareFunc = compareFunc
        self.argv = self.makeCommandLine(options, args)
        return

    def makeCommandLine(self, options, args):
        argv = []

        # create the options list
        for name, value in options.items():
            if value:
                if ' ' in str(value):
                    value = '"%s"' % value
                option = '--%s=%s' % (name, value)
            else:
                option = '--%s' % name
            argv.append(option)

        # create the argument list
        for arg in args:
            if ' ' in str(arg):
                arg = '"%s"' % arg
            argv.append(arg)

        return ' '.join(argv)

    def test(self, tester, script):

       # create the display version of the commandline
        title = script + ' ' + self.argv

        # create the complete commandline
        script = os.path.join(Ft.GetConfigVar('BINDIR'), script)
        command = script + ' ' + self.argv

        tester.startGroup(self.name)
        tester.startTest(title)

        if self.skipOutputTest:
            if self.input:
                pipe = os.popen(command, 'w')
                pipe.write(self.input)
                status = pipe.close()
            else:
                pipe = os.popen(command, 'r')
                result = pipe.read()
                try:
                    status = pipe.close()
                except IOError, e:
                    status = -1
            if status is not None:
                # re-run the command capturing the output
                input, output = os.popen4(command)
                input.close()
                error = output.read()
                try:
                    output.close()
                except IOError:
                    pass
                tester.error("Error executing '%s':\n%s" % (script, error))
        else:
            # popen4 combines stdout and stderr into one stream
            input, output = os.popen4(command)

            # Send the input to the command
            if self.input:
                input.write(self.input)
            input.close()

            # Get the output from the command
            result = output.read()
            try:
                output.close()
            except IOError:
                # Windows sometimes complains
               pass

            # Use the output file instead of the stream content
            if self.output:
                f = open(self.output)
                result = f.read()
                f.close()
                os.remove(self.output)

            if result:
                if not self.expectedOut:
                    tester.warning("Unexpected output:\n%r" % result)
                else:
                    tester.compare(self.expectedOut, result,
                                   func=self.compareFunc, diff=1)
            elif self.expectedOut:
                tester.error("Missing expected output:\n%r" % self.expectedOut)

        if self.validationFunc and not self.validationFunc(tester):
            tester.error("Validation Failed")

        tester.testDone()
        tester.groupDone()
        return

class Test:

    def __init__(self, commandName, runs):
        self.commandName = commandName
        self.runs = runs
        return

    def test(self, tester):
        tester.startGroup("Command-line %r" % self.commandName)
        for run in self.runs:
            run.test(tester, self.commandName)
        tester.groupDone()


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0042 ]--