Exemplo n.º 1
0
        "BObject.Replication.Store=2"
    fileSystemName = "directoryTestFS"
    fileSystemPassword = "******"

    celestefs = Celestefs(myId, myPassword, "127.0.0.1", 14000,
        replicationParams, jvmopts=["-server", "-ea"])
    #
    # 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 the directory and its
    # entries are to live.
    #
    if not celestefs.fileSystemExists(fileSystemName):
        fsAttrs = {
            "MaintainSerialNumbers" : "false"
        }
        celestefs.mkfs(fileSystemName, fileSystemPassword, attrs=fsAttrs)

    nameGen = FileNameGenerator(20)

    #
    # XXX:  The code below assumes that name collisions won't happen.
Exemplo n.º 2
0
#       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):
        createAttrs = {
            # "BlockSize" : "3"
            # "BlockSize" : "16"