예제 #1
0
        "Credential.Replication.Store=1"
    fileSystemName = "exampleFS"
    fileSystemPassword = "******"

    #
    # Use the 64-bit Jvm so that we can handle large files.  Disable socket
    # timeouts, so that lengthy i/os don't trigger them.  Request chattiness
    # from the CelesteFs implementation layer.
    #
    celestefs = Celestefs(myId, myPassword, "127.0.0.1", 14000,
        replicationParams, timeout=0,
        jvmopts=["-server", "-ea", "-Dverbose=true", "-Xmx600m", "-Xms600m", "-XX:+UseParallelGC"])
    #
    # Arrange to see what JVM invocations are issued.
    #
    celestefs.verbose = True
    

    #
    # Ensure that the credential corresponding to myId and myPassword exists.
    #
    if not celestefs.credentialExists(myId):
        celestefs.mkid()

    #
    # Now do the same thing for the file system in which inFileName's to be
    # stored.
    #
    if not celestefs.fileSystemExists(fileSystemName):
        celestefs.mkfs(fileSystemName, fileSystemPassword)
    #
예제 #2
0
# file offsets properly.
#
# XXX:  This test should be tidied up a bit.  It should accept the file name
#       as argument, so that it can be run repeatedly.  It should also accept
#       a block size argument.
#

from celestefs import Celestefs
from sys import exit, stderr

if __name__ == "__main__":

    name = "offsetTest"

    c = Celestefs(name, name)
    c.verbose = True

    if not c.credentialExists(name):
        c.mkid()

    if not c.fileSystemExists(name):
        if not c.mkfs(name, name):
            print "mkfs(%s, %s) failed" % (name, name)
            exit(1)

    filename = "/" + name + "/" + "file"

    #
    # Create or truncate the test file, as approriate.
    #
    if not c.fileExists(filename):