print "---- put files ----" txt1 = "foocorp" txt2 = "This is a longer sentence. Let's hope this works." whitespace() put_file(vol, "/foo", 0700, txt1) whitespace() put_file(vol, "/bar", 0700, txt2) whitespace() print "---- get files ----" whitespace() dat1 = get_file(vol, "/foo") assert dat1 == txt1, "Expected '%s', got '%s'" % (txt1, dat1) whitespace() dat2 = get_file(vol, "/bar") assert dat2 == txt2, "Expected '%s', got '%s'" % (txt2, dat2) whitespace() print "---- remove files ----" whitespace() assert vol.unlink("/foo") == 0, "unlink /foo failed" whitespace() assert vol.unlink("/bar") == 0, "unlink /bar failed"
print "list /dir3" whitespace() dfd = vol.opendir( "/dir3" ) whitespace() print vol.readdir( dfd ) whitespace() vol.closedir( dfd ) whitespace() print "---- remove files ----" whitespace() assert vol.unlink( "/foo" ) == 0, "unlink /foo failed" whitespace() assert vol.unlink( "/bar" ) == 0, "unlink /bar failed" whitespace() assert vol.unlink( "/baz" ) == 0, "unlink /baz failed" whitespace() assert vol.unlink( "/dir1/foo2" ) == 0, "unlink /dir1/foo2 failed" whitespace() assert vol.unlink( "/dir1/dir2/bar3" ) == 0, "unlink /dir1/dir2/bar3 failed" whitespace() assert vol.unlink( "/dir3/baz4" ) == 0, "unlink /dir3/baz4 failed"
txt1 = "foocorp" txt2 = "This is a longer sentence. Let's hope this works." whitespace() put_file( vol, "/foo", 0700, txt1 ) whitespace() put_file( vol, "/bar", 0700, txt2 ) whitespace() print "---- get files ----" whitespace() dat1 = get_file( vol, "/foo" ) assert dat1 == txt1, "Expected '%s', got '%s'" % (txt1, dat1) whitespace() dat2 = get_file( vol, "/bar" ) assert dat2 == txt2, "Expected '%s', got '%s'" % (txt2, dat2) whitespace() print "---- remove files ----" whitespace() assert vol.unlink( "/foo" ) == 0, "unlink /foo failed" whitespace() assert vol.unlink( "/bar" ) == 0, "unlink /bar failed"