!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/lib/4Suite/tests/Server/Client/Commands/   drwxr-xr-x
Free 1.94 GB of 27.03 GB (7.17%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_create_raw_file.py (2.98 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import os, tempfile

from Ft.Lib.CommandLine import CommandLineTestUtil
from Ft.Lib.Uri import OsPathToUri
from Ft.Server.Client import Core
from Server.Client.Core import test_helper

import test_prime

FIRST_RAWFILE = '/' + test_prime.BASE_CONTAINER + '/rf1'
FIRST_ALIAS = '/' + test_prime.BASE_CONTAINER + '/rfa1'
SECOND_RAWFILE = '/' + test_prime.BASE_CONTAINER + '/rf2'
SECOND_ALIAS = '/' + test_prime.BASE_CONTAINER + '/rfa2'


def val1(tester):
    repo = test_helper.GetRepo(tester)
    try:
        if not repo.hasResource(FIRST_RAWFILE):
            return 0
        if not repo.hasResource(FIRST_ALIAS):
            return 0
        tester.compare(RAW1,repo.fetchResource(FIRST_RAWFILE).getContent())
        return 1

    finally:
        repo.txRollback()

def val2(tester):
    repo = test_helper.GetRepo(tester)
    try:
        if not repo.hasResource(SECOND_RAWFILE):
            return 0
        if not repo.hasResource(SECOND_ALIAS):
            return 0
        tester.compare(RAW1,repo.fetchResource(SECOND_RAWFILE).getContent())
        return 1
    finally:
        repo.txRollback()


def Init(repo):
    for uri in [FIRST_RAWFILE,
                SECOND_RAWFILE,
                FIRST_ALIAS,
                SECOND_ALIAS]:
        if repo.hasResource(uri):
            repo.deleteResource(uri,traverseAliases=0)

def Test(tester):

    test_prime.InitRepo(tester,Init,['4ss','create','rawfile'])

    baseConfig = {'host':tester.test_data['ftrpc-host'],
                  'port':tester.test_data['ftrpc-port'],
                  'username':tester.test_data['userName'],
                  'password':tester.test_data['password'],
                  }

    tempFiles = []
    fileName = tempfile.mktemp()
    f = open(fileName,'w')
    f.write(RAW1)
    f.close()
    fileUri = OsPathToUri(fileName)

    try:
        tempFiles.append(fileName)
        tr1 = CommandLineTestUtil.TestRun('Basic Create',
                                          baseConfig,
                                          [FIRST_RAWFILE,fileUri,FIRST_ALIAS],
                                          validationFunc = val1)

        #Create a raw file from stdin
        tr2 = CommandLineTestUtil.TestRun('STDIN Create',
                                          baseConfig,
                                          [SECOND_RAWFILE,'-',SECOND_ALIAS],
                                          validationFunc = val2,
                                          input=RAW1)

        #Create a RF that does not exist
        uri = '/' + test_prime.BASE_CONTAINER + '/rf1'
        tr3 = CommandLineTestUtil.TestRun('Re-Create',
                                          baseConfig,
                                          [uri,fileUri],
                                          expected_3%uri)


        t = CommandLineTestUtil.Test('4ss create rawfile',[tr1,tr2,tr3])

        return t.test(tester)
    finally:
        for f in tempFiles:
            os.unlink(f)
RAW1 = """This is a text file"""

expected_3 = "Path %s is already in the repository\n"


:: 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.0035 ]--