예제 #1
0
def test_all():
    scsbox = SCSBox()
    scsbox.put_file(
        "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/54D88381B61A3B2EB28942663A98410A",
        {
            "hash": "54D88381B61A3B2EB28942663A98410A",
            "hashtype": 1,
            "source": "201",
            "FileName": "helloworld.txt",
            "FilePath": "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
        }, "wcollecter", "bavwc1234asdf")
    print scsbox.stat_file("54D88381B61A3B2EB28942663A98410A")
    print scsbox.stat_file("00000000000000000000000000000000")
    if scsbox.check_sample_existed("54D88381B61A3B2EB28942663A98410A"):
        print "put succeeded"
    if scsbox.check_sample_existed(
            "00000000000000000000000000000000") == False:
        print "it is right!"
    if scsbox.get_to_file(
            "54D88381B61A3B2EB28942663A98410A",
            "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/hello.txt"):
        print "succeeded to get file"
    if scsbox.get_to_file(
            "00000000000000000000000000000000",
            "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/hello000.txt"
    ) == False:
        print "it is right!"
예제 #2
0
def test_all():
    scsbox = SCSBox("store.bav.baidu.com", 8080)
    scsbox.put_file("/home/pengchong/src/ws/server/sample_cloud_sdk/scs/00000072E6E3C20F4D10F68DEEFA6BFB",
                    {"hash" : "00000072E6E3C20F4D10F68DEEFA6BFB",
                      "hashtype" : 1,
                     "source" : "101",
                     "FileName" : "sample.exe",
                     "FilePath" : "c:\sample.exe"
                     })
    print scsbox.stat_file("00000072E6E3C20F4D10F68DEEFA6BFB")
    print scsbox.stat_file("00000000000000000000000000000000")
    if scsbox.check_sample_existed("00000072E6E3C20F4D10F68DEEFA6BFB"):
        print "put succeeded"
    if scsbox.check_sample_existed("00000000000000000000000000000000") == False:
        print "it is right!"
    if scsbox.get_to_file("00000072E6E3C20F4D10F68DEEFA6BFB",
                       "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/local_sample"):
        print "succeeded to get file"
    if scsbox.get_to_file("00000000000000000000000000000000",
                       "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/local_sample_000") == False:
        print "it is right!"

    status = scsbox.put_file("/home/pengchong/src/ws/server/sample_cloud_sdk/scs/00000072E6E3C20F4D10F68DEEFA6BFB",
                    {"hash" : "00000072E6E3C20F4D10F68DEEFA6BFB",
                      "hashtype" : 1,
                     "source" : "101",
                     "FileName" : "sample.exe",
                     "FilePath" : "c:\sample.exe"
                     })
    if status == 2:
        print "it is right!"
예제 #3
0
def test_put3():
    scsbox = SCSBox()
    scsbox.put_file("/home/xuzeshui/src/bav-cloud/bcs_sample/scs/C27E59D45E9FD16626E8FEF4684F10EB",
                    {"hash" : "C27E59D45E9FD16626E8FEF4684F10EB",
                     "hashtype" : 1,
                     "source" : "101",
                     "FileName" : "helloworld.txt",
                     "FilePath" : "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
                     },
                     "wcollecter",
                     "bavwc1234asdf")
예제 #4
0
def test_put2():
    scsbox = SCSBox()
    scsbox.put_file("/home/xuzeshui/src/bav-cloud/bcs_sample/scs/FF0D8FD026C1DF74D12E2F1FC40992EF",
                    {"hash" : "FF0D8FD026C1DF74D12E2F1FC40992EF",
                     "hashtype" : 1,
                     "source" : "101",
                     "FileName" : "helloworld.txt",
                     "FilePath" : "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
                     },
                     "wcollecter",
                     "bavwc1234asdf")
예제 #5
0
def test_put():
    scsbox = SCSBox()
    scsbox.put_file("/home/xuzeshui/src/bav-cloud/bcs_sample/scs/54D88381B61A3B2EB28942663A98410A",
                    {"hash" : "54D88381B61A3B2EB28942663A98410A",
                     "hashtype" : 1,
                     "source" : "201",
                     "FileName" : "helloworld.txt",
                     "FilePath" : "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
                     },
                     "wcollecter",
                     "bavwc1234asdf")
예제 #6
0
def test_put3():
    scsbox = SCSBox()
    scsbox.put_file(
        "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/C27E59D45E9FD16626E8FEF4684F10EB",
        {
            "hash": "C27E59D45E9FD16626E8FEF4684F10EB",
            "hashtype": 1,
            "source": "101",
            "FileName": "helloworld.txt",
            "FilePath": "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
        }, "wcollecter", "bavwc1234asdf")
예제 #7
0
def test_put2():
    scsbox = SCSBox()
    scsbox.put_file(
        "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/FF0D8FD026C1DF74D12E2F1FC40992EF",
        {
            "hash": "FF0D8FD026C1DF74D12E2F1FC40992EF",
            "hashtype": 1,
            "source": "101",
            "FileName": "helloworld.txt",
            "FilePath": "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
        }, "wcollecter", "bavwc1234asdf")
예제 #8
0
def test_put():
    scsbox = SCSBox()
    scsbox.put_file(
        "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/54D88381B61A3B2EB28942663A98410A",
        {
            "hash": "54D88381B61A3B2EB28942663A98410A",
            "hashtype": 1,
            "source": "201",
            "FileName": "helloworld.txt",
            "FilePath": "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
        }, "wcollecter", "bavwc1234asdf")
예제 #9
0
def test_put():
    scsbox = SCSBox("store.bav.baidu.com", 8080)
    scsbox.put_file(
        "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/A02EEEB7601FEDD4EE6323A02087919B",
        {
            "hash": "A02EEEB7601FEDD4EE6323A02087919B",
            "hashtype": 1,
            "source": "0",
            "FileName": "",
            "FilePath": ""
        }, "wcollecter", "bavwc1234asdf")
예제 #10
0
def test_put():
    scsbox = SCSBox("store.bav.baidu.com", 8080)
    scsbox.put_file("/home/pengchong/src/ws/server/sample_cloud_sdk/scs/A02EEEB7601FEDD4EE6323A02087919B",
                    {"hash" : "A02EEEB7601FEDD4EE6323A02087919B",
                     "hashtype" : 1,
                     "source" : "0",
                     "FileName" : "",
                     "FilePath" : ""
                     },
                     "wcollecter",
                     "bavwc1234asdf")
예제 #11
0
def test_all():
    scsbox = SCSBox("store.bav.baidu.com", 8080)
    scsbox.put_file(
        "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/00000072E6E3C20F4D10F68DEEFA6BFB",
        {
            "hash": "00000072E6E3C20F4D10F68DEEFA6BFB",
            "hashtype": 1,
            "source": "101",
            "FileName": "sample.exe",
            "FilePath": "c:\sample.exe"
        })
    print scsbox.stat_file("00000072E6E3C20F4D10F68DEEFA6BFB")
    print scsbox.stat_file("00000000000000000000000000000000")
    if scsbox.check_sample_existed("00000072E6E3C20F4D10F68DEEFA6BFB"):
        print "put succeeded"
    if scsbox.check_sample_existed(
            "00000000000000000000000000000000") == False:
        print "it is right!"
    if scsbox.get_to_file(
            "00000072E6E3C20F4D10F68DEEFA6BFB",
            "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/local_sample"):
        print "succeeded to get file"
    if scsbox.get_to_file(
            "00000000000000000000000000000000",
            "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/local_sample_000"
    ) == False:
        print "it is right!"

    status = scsbox.put_file(
        "/home/pengchong/src/ws/server/sample_cloud_sdk/scs/00000072E6E3C20F4D10F68DEEFA6BFB",
        {
            "hash": "00000072E6E3C20F4D10F68DEEFA6BFB",
            "hashtype": 1,
            "source": "101",
            "FileName": "sample.exe",
            "FilePath": "c:\sample.exe"
        })
    if status == 2:
        print "it is right!"
예제 #12
0
def test_all():
    scsbox = SCSBox()
    scsbox.put_file("/home/xuzeshui/src/bav-cloud/bcs_sample/scs/54D88381B61A3B2EB28942663A98410A",
                    {"hash" : "54D88381B61A3B2EB28942663A98410A",
                     "hashtype" : 1,
                     "source" : "201",
                     "FileName" : "helloworld.txt",
                     "FilePath" : "/home/xuzeshui/src/bav-cloud/bcs_sample/scs"
                     },
                     "wcollecter",
                     "bavwc1234asdf")
    print scsbox.stat_file("54D88381B61A3B2EB28942663A98410A")
    print scsbox.stat_file("00000000000000000000000000000000")
    if scsbox.check_sample_existed("54D88381B61A3B2EB28942663A98410A"):
        print "put succeeded"
    if scsbox.check_sample_existed("00000000000000000000000000000000") == False:
        print "it is right!"
    if scsbox.get_to_file("54D88381B61A3B2EB28942663A98410A",
                       "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/hello.txt"):
        print "succeeded to get file"
    if scsbox.get_to_file("00000000000000000000000000000000",
                       "/home/xuzeshui/src/bav-cloud/bcs_sample/scs/hello000.txt") == False:
        print "it is right!"