Exemplo n.º 1
0
def main():

    test.log("Test Case Name: tst_create_delivery_for_bulk_revert")
    '''run the script to set the delivery'''

    # arguments to pass: 1 create a campaign with start date in the past and end date in future and any campaign Id: 84062112
    # arguments to pass: 2 QUEUED -create a campaign with start date in the future and end date in future and any campaign Id: 84062112
    # arguments to pass: 3 create a campaign with start date in the past and end date in past and any campaign Id: 84062112
    test.log("update adbroker database for campaign start and end dates")
    os.system("C:\\utils\\run_update_campaign_dates.bat 1 12735523")

    test.log("create successful delivery")
    delivery_id = None
    delivery_stage = None
    create_delivery_data = {
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile":
        'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile":
        'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '6287',
        "campaignId": '12735523',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False
    }

    videoISRC = "USUV71100201"
    #os.system("C:\\utils\\run_update_campaign_end_dates.bat 12735523")

    data = testData.dataset("s_list_of_webservices.tsv")[0]

    create_delivery_url = testData.field(
        data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")

    data = testData.dataset("ftp_login_details.tsv")[0]
    ftp_vevo_host = testData.field(data, "ftp_vevo_host")
    ftp_vevo_user = testData.field(data, "ftp_vevo_user")
    ftp_vevo_password = testData.field(data, "ftp_vevo_password")

    local_manifest_file_path = findFile(
        "testdata",
        "vevo_status\\parse_success_replace_success\\status-manifest.xml")

    squish.snooze(30)
    delivery_id = create_delivery_and_save_delivery_id_to_tsv(
        create_delivery_url, create_delivery_data, videoISRC)
    squish.snooze(30)
    delivery_stage = check_delivery_status_until_waiting_on_confirmation(
        get_delivery_status_url, delivery_id)
    ftp_transfer(get_delivery_status_url, delivery_id, delivery_stage,
                 ftp_vevo_host, ftp_vevo_user, ftp_vevo_password,
                 local_manifest_file_path)
def main():

    test.log("Test Case Name: test_create_cancel_remove")

    data = testData.dataset("s_list_of_webservices.tsv")[0]

    create_delivery_data_success = {
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile":
        'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile":
        'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '12230',
        "campaignId": '27120900',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False
    }

    create_delivery_url = testData.field(
        data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    cancel_delivery_url = testData.field(data,
                                         "cancel_delivery_using_post_url")
    remove_delivery_url = testData.field(data,
                                         "delete_delivery_using_delete_url")
    success = False
    '''t01 ftp connection login details'''
    ftp_vevo_host = "ftp.uk.mirriad.com"
    ftp_vevo_user = "******"
    ftp_vevo_password = "******"
    ftp_vevo_port = 21
    ftp_vevo_vevo_user = "******"

    source(findFile("scripts", "test_create_cancel_remove.py"))

    success = create_cancel_remove_delivery(
        create_delivery_url, create_delivery_data_success,
        get_delivery_status_url, cancel_delivery_url, remove_delivery_url,
        ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, success)
    if (success):
        test.passes("test_create_cancel_remove passed")
    else:
        test.fail("test_create_cancel_remove failed")
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")
        except Exception as e:
            print e
            s = str(e)
            test.log(s)
def main():
    
    test.log("Test Case Name: tst_create_delivery_for_bulk_revert")
 
    '''run the script to set the delivery'''
    
    # arguments to pass: 1 create a campaign with start date in the past and end date in future and any campaign Id: 84062112
    # arguments to pass: 2 QUEUED -create a campaign with start date in the future and end date in future and any campaign Id: 84062112
    # arguments to pass: 3 create a campaign with start date in the past and end date in past and any campaign Id: 84062112
    test.log("update adbroker database for campaign start and end dates")
    os.system("C:\\utils\\run_update_campaign_dates.bat 1 12735523")
    
    test.log("create successful delivery")
    delivery_id = None
    delivery_stage = None
    create_delivery_data = { 
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '6287',
        "campaignId": '12735523',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False 
    }
        
    videoISRC = "USUV71100201" 
    #os.system("C:\\utils\\run_update_campaign_end_dates.bat 12735523")

        
    data = testData.dataset("s_list_of_webservices.tsv")[0]
            
    create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
       
    
    data = testData.dataset("ftp_login_details.tsv")[0]
    ftp_vevo_host = testData.field(data, "ftp_vevo_host")  
    ftp_vevo_user = testData.field(data, "ftp_vevo_user")  
    ftp_vevo_password = testData.field(data, "ftp_vevo_password")  
    
    local_manifest_file_path = findFile("testdata", "vevo_status\\parse_success_replace_success\\status-manifest.xml")

    squish.snooze(30)
    delivery_id = create_delivery_and_save_delivery_id_to_tsv(create_delivery_url, create_delivery_data,videoISRC)
    squish.snooze(30)
    delivery_stage = check_delivery_status_until_waiting_on_confirmation(get_delivery_status_url, delivery_id)
    ftp_transfer(get_delivery_status_url, delivery_id, delivery_stage, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, local_manifest_file_path)
Exemplo n.º 4
0
def main():
    test.log("Test Case Name: test_create_restart_remove")

    data = testData.dataset("s_list_of_webservices.tsv")[0]

    create_failed_delivery_data = {
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile": 'hub://hub-t1/mirriad/storage/QA/MP4.mp4',
        "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/MP41.mp4',
        "assetId": '10006',
        "campaignId": '10450402',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False
    }

    create_delivery_url = testData.field(
        data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    restart_delivery_url = testData.field(data,
                                          "restart_delivery_using_put_url")
    remove_delivery_url = testData.field(data,
                                         "delete_delivery_using_delete_url")
    success = False

    source(findFile("scripts", "test_create_restart_remove.py"))

    success = create_restart_remove_delivery(create_delivery_url,
                                             create_failed_delivery_data,
                                             get_delivery_status_url,
                                             restart_delivery_url,
                                             remove_delivery_url, success)

    if (success):
        test.passes("test_create_restart_remove delivery passed")
    else:
        test.fail("test_create_restart_remove delivery failed")
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")
        except Exception as e:
            print e
            s = str(e)
            test.log(s)
def main():

    test.log("Test Case Name: test_create_cancel_remove")
    
    data = testData.dataset("s_list_of_webservices.tsv")[0]
    
    create_delivery_data_success = { 
    "serviceOriginName": "Dove UI",
    "callBackEndPoint": None,
    "callBackReferenceId": None,
    "requestTime": None,
    "sourceFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
    "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
    "assetId": '12230',
    "campaignId": '27120900',
    "deliveryTargetService": 'VEVO',
    "revertOperation": False 
    }
    
    create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    cancel_delivery_url = testData.field(data, "cancel_delivery_using_post_url")
    remove_delivery_url = testData.field(data, "delete_delivery_using_delete_url") 
    success = False
    '''t01 ftp connection login details'''
    ftp_vevo_host = "ftp.uk.mirriad.com"
    ftp_vevo_user = "******"
    ftp_vevo_password = "******"
    ftp_vevo_port = 21
    ftp_vevo_vevo_user = "******"
    
    source(findFile("scripts", "test_create_cancel_remove.py"))
    
    success  = create_cancel_remove_delivery(create_delivery_url, create_delivery_data_success, get_delivery_status_url, cancel_delivery_url, remove_delivery_url, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, success)
    if(success):
        test.passes("test_create_cancel_remove passed")
    else:
        test.fail("test_create_cancel_remove failed")
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")  
        except Exception as e:
            print e
            s = str(e)
            test.log(s)
def main():
    
    test.log("Test Case Name: tst_start_bulk_revert_delivery")
    
    data = testData.dataset("s_list_of_webservices.tsv")[0]
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    revert_all_deliveries_get_call = testData.field(data, "revert_all_deliveries_get_call")

    data = testData.dataset("delivery_ids_for_bulk_reverting.tsv")[0]
    parent_delivery_id = testData.field(data, "delivery_id")  
    videoISRC = testData.field(data, "videoISRC")
    
    test.log(" get_delivery_status_url : " + get_delivery_status_url)  
    test.log(" revert_all_deliveries_get_call : " + revert_all_deliveries_get_call) 
    test.log(" delivery_id : " + parent_delivery_id)
    test.log(" videoISRC: " + videoISRC)
    
    data = testData.dataset("ftp_login_details.tsv")[0]
    ftp_vevo_host = testData.field(data, "ftp_vevo_host")  
    ftp_vevo_user = testData.field(data, "ftp_vevo_user")  
    ftp_vevo_password = testData.field(data, "ftp_vevo_password")  
    
    manifest_parse_success_replace_success = findFile("testdata", "vevo_status\\parse_success_replace_success\\status-manifest.xml")
    
    squish.snooze(40)

    # latest_revert_id = "ff80808147da5cc80147e9c872f00172"
    latest_revert_id = bulk_revert_delivery(revert_all_deliveries_get_call,get_delivery_status_url,parent_delivery_id)
    if(latest_revert_id and latest_revert_id != None):
        delivery_stage = check_delivery_status_until_waiting_on_confirmation(get_delivery_status_url, latest_revert_id)
        ftp_transfer(get_delivery_status_url, parent_delivery_id, latest_revert_id, delivery_stage, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, manifest_parse_success_replace_success)
    else:
        test.fail("latest revert id is null or doesn't exist")
def main():
    test.log("Test Case Name: test_create_restart_remove")
    
    data = testData.dataset("s_list_of_webservices.tsv")[0]
    
    create_failed_delivery_data = { 
    "serviceOriginName": "Dove UI",
    "callBackEndPoint": None,
    "callBackReferenceId": None,
    "requestTime": None,
    "sourceFile": 'hub://hub-t1/mirriad/storage/QA/MP4.mp4',
    "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/MP41.mp4',
    "assetId": '10006',
    "campaignId": '10450402',
    "deliveryTargetService": 'VEVO',
    "revertOperation": False 
    }
    
    create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    restart_delivery_url = testData.field(data, "restart_delivery_using_put_url")
    remove_delivery_url = testData.field(data, "delete_delivery_using_delete_url") 
    success = False
    
    source(findFile("scripts", "test_create_restart_remove.py"))

    success = create_restart_remove_delivery(create_delivery_url, create_failed_delivery_data, get_delivery_status_url, restart_delivery_url, remove_delivery_url, success)
    
    if(success):
        test.passes("test_create_restart_remove delivery passed")
    else:
        test.fail("test_create_restart_remove delivery failed")
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")  
        except Exception as e:
            print e
            s = str(e)
            test.log(s)      
Exemplo n.º 8
0
def main():

    test.log("Test Case Name: tst_start_bulk_revert_delivery")

    data = testData.dataset("s_list_of_webservices.tsv")[0]
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")
    revert_all_deliveries_get_call = testData.field(
        data, "revert_all_deliveries_get_call")

    data = testData.dataset("delivery_ids_for_bulk_reverting.tsv")[0]
    parent_delivery_id = testData.field(data, "delivery_id")
    videoISRC = testData.field(data, "videoISRC")

    test.log(" get_delivery_status_url : " + get_delivery_status_url)
    test.log(" revert_all_deliveries_get_call : " +
             revert_all_deliveries_get_call)
    test.log(" delivery_id : " + parent_delivery_id)
    test.log(" videoISRC: " + videoISRC)

    data = testData.dataset("ftp_login_details.tsv")[0]
    ftp_vevo_host = testData.field(data, "ftp_vevo_host")
    ftp_vevo_user = testData.field(data, "ftp_vevo_user")
    ftp_vevo_password = testData.field(data, "ftp_vevo_password")

    manifest_parse_success_replace_success = findFile(
        "testdata",
        "vevo_status\\parse_success_replace_success\\status-manifest.xml")

    squish.snooze(40)

    # latest_revert_id = "ff80808147da5cc80147e9c872f00172"
    latest_revert_id = bulk_revert_delivery(revert_all_deliveries_get_call,
                                            get_delivery_status_url,
                                            parent_delivery_id)
    if (latest_revert_id and latest_revert_id != None):
        delivery_stage = check_delivery_status_until_waiting_on_confirmation(
            get_delivery_status_url, latest_revert_id)
        ftp_transfer(get_delivery_status_url, parent_delivery_id,
                     latest_revert_id, delivery_stage, ftp_vevo_host,
                     ftp_vevo_user, ftp_vevo_password,
                     manifest_parse_success_replace_success)
    else:
        test.fail("latest revert id is null or doesn't exist")
def main(): 
    
    test.log("Test Case Name: tst_bulk_start_queued_deliveries")
    data = testData.dataset("s_list_of_webservices.tsv")[0]
    start_queued_deliveries_get = testData.field(data, "start_queued_deliveries_get_call")
    
    #revert_delivery_with_id_put = testData.field(data, "revert_delivery_with_id_put_call")
    #revert_all_deliveries_get = testData.field(data, "revert_all_deliveries_get_call")
    
    get_delivery_status_url = testData.field(data, "get_delivery_status_url")


    data = testData.dataset("delivery_ids_for_reverting.tsv")[0]
    delivery_id = testData.field(data, "delivery_id")  
    videoISRC = testData.field(data, "videoISRC")
    
    
    data = testData.dataset("ftp_login_details.tsv")[0]
    ftp_vevo_host = testData.field(data, "ftp_vevo_host")  
    ftp_vevo_user = testData.field(data, "ftp_vevo_user")  
    ftp_vevo_password = testData.field(data, "ftp_vevo_password")  
    # ftp_vevo_port = testData.field(data, "ftp_vevo_port")  
    # ftp_vevo_vevo_user = testData.field(data, "ftp_vevo_vevo_user")  
        
    #manifest_parse_success_replace_success = "vevo_status\\parse_success_replace_success\\status-manifest.xml"

    test.log("get_delivery_status_url: " + get_delivery_status_url)
    test.log("delivery_id: " + delivery_id) 
    test.log("videoISRC: " + videoISRC) 
    
    manifest_parse_success_replace_success = findFile("testdata", "vevo_status\\parse_success_replace_success\\status-manifest.xml")

    squish.snooze(30)
    start_queued_deliveries(start_queued_deliveries_get)
    delivery_stage = check_delivery_status_until_waiting_on_confirmation(get_delivery_status_url, delivery_id)
    ftp_transfer(get_delivery_status_url, delivery_id,delivery_stage, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, manifest_parse_success_replace_success)
Exemplo n.º 10
0
def main():
    try:
        
        test.log("Test Case Name: tst_create_parse_success_delivery")
        test.log("create parse success delivery")
    
        create_delivery_data_success = { 
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '12230',
        "campaignId": '27120900',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False 
        }
        
        videoISRC = "GBUV71000779" # I am Arrows
        
        data = testData.dataset("s_list_of_webservices.tsv")[0]
            
        hub_status_config_url = testData.field(data, "get_delivery_config_get_url")
        create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
        get_delivery_status_url = testData.field(data, "get_delivery_status_url")
        manifest_parse_success_replace_success = "vevo_status\\parse_success_replace_success\\status-manifest.xml"
        manifest_parse_success = "vevo_status\\parse_success\\status-manifest.xml"
        #manifest_parse_success_replace_success = findFile("testdata", "vevo_status\\parse_success_replace_success\\status-manifest.xml")
        #manifest_parse_success = findFile("testdata", "vevo_status\\parse_success\\status-manifest.xml")
        delivery_ftp_path = None
        '''t01 ftp connection login details'''
        ftp_vevo_host = "ftp.uk.mirriad.com"
        ftp_vevo_user = "******"
        ftp_vevo_password = "******"
        ftp_vevo_port = 21
        ftp_vevo_vevo_user = "******"
        
        test.log("manifest_parse_success : " + manifest_parse_success)
        test.log("manifest_parse_success_replace_success : " + manifest_parse_success_replace_success)
        
        x = None
        count = 4 # using count for FTP transfer as a trigger
        delivery_id = None
        delivery_stage = None
        source(findFile("scripts", "create_delivery.py"))
        
        delivery_id = create_delivery_first_step(create_delivery_data_success, videoISRC, hub_status_config_url, create_delivery_url, get_delivery_status_url, manifest_parse_success, manifest_parse_success_replace_success, count, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password)
        squish.snooze(60)

        if(delivery_id or delivery_id != None):
            source(findFile("scripts", "deliverywebservices.py"))
            squish.snooze(60)
            delivery_stage = check_delivery_status(get_delivery_status_url, delivery_id)
            delivery_ftp_path = get_delivery_ftp_path(get_delivery_status_url, delivery_id, count)

        '''remove the delivery as it is on waiting on confirmation, you cannot use the same delivery again
        transfer the file and change the status to completed'''
  
        if(delivery_stage == "WAITING_ON_CONFIRMATION"):
            test.passes("parse_success is successful")
            source(findFile("scripts", "connect_to_ftpserver.py"))
            manifest_parse_success_replace_success = findFile("testdata", manifest_parse_success_replace_success)
            squish.snooze(60)
            copy_to_ftp_server(manifest_parse_success_replace_success, delivery_ftp_path, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password)
            source(findFile("scripts", "deliverywebservices.py"))
            squish.snooze(60)
            delivery_stage = check_delivery_status(get_delivery_status_url, delivery_id)
            if(delivery_stage == "COMPLETE"):
                test.passes("parse_success is successful and parse_success_replace_success is also successful")
            else:
                test.fail("parse_success_replace_success in parse success delivery has failed, deliveryStage : " + delivery_stage)
        elif(delivery_stage == "FAILED"):
            test.fail("Delivery stage is failed after copying parse success file so need not copy parse success replace success file")
        else:
            test.fail("parse_success delivery has failed")
    except Exception as e:
        print e
        s = str(e)
        print sys.exc_info()
        test.log(s)
        test.fail("parse_success has failed due to : " + s)
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")  
        except Exception as e:
            print e
            s = str(e)
            test.log(s)
Exemplo n.º 11
0
def main():
    
    test.log("Test Case Name: tst_create_queued_delivery")
 
    '''run the script to set the queued delivery'''
    
    # arguments to pass: 1 create a campaign with start date in the past and end date in future and any campaign Id: 84062112
    # arguments to pass: 2 QUEUED -create a campaign with start date in the future and end date in future and any campaign Id: 84062112
    # arguments to pass: 3 create a campaign with start date in the past and end date in past and any campaign Id: 84062112
    test.log("update adbroker database for campaign start and end dates")
    os.system("C:\\utils\\run_update_campaign_dates.bat 2 84062112")
    
    try:
        test.log("create successful delivery")
        delivery_id = None
        delivery_stage = None
        create_delivery_data = { 
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '4134',
        "campaignId": '84062112',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False 
        }
        
        videoISRC = "USUV71201410" 
        
        data = testData.dataset("s_list_of_webservices.tsv")[0]
            
        create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
        get_delivery_status_url = testData.field(data, "get_delivery_status_url")
        
        source(findFile("scripts", "deliverywebservices.py"))

        '''create the delivery'''
        delivery_id = create_save_delivery_using_post_url(create_delivery_url, create_delivery_data)
        squish.snooze(40)
        
        delivery_stage = check_delivery_status(get_delivery_status_url, delivery_id)
        
        if(delivery_id and delivery_id != None and delivery_stage == "QUEUED"):
            
            test.log("delivery successfully created", delivery_id)
            testdata = testData.create("shared", "delivery_ids_for_reverting.tsv")
            dataFile = open(testdata, "w")
            dataFile.write("delivery_id\tvideoISRC\n")
            dataFile.write(delivery_id + "\t" + videoISRC)
            dataFile.close()
            test.log("tsv created")
        else:
            test.fail("delivery id is none or delivery stage is not queued")
    
    except Exception as e:
        print e
        s = str(e)
        print sys.exc_info()
        test.fail("create queued delivery has failed")
        if(s and s!=None):
            test.log(s)
            test.fail("create queued delivery has failed due to :" + s)
Exemplo n.º 12
0
def main():
    try:
        test.log("Test Case Name: tst_create_parse_success_replace_failure")

        test.log("create parse success replace failure delivery")
    
        create_delivery_data_success = { 
        "serviceOriginName": "Dove UI",
        "callBackEndPoint": None,
        "callBackReferenceId": None,
        "requestTime": None,
        "sourceFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_no_P_logo_v2.mov',
        "deliveryFile": 'hub://hub-t1/mirriad/storage/QA/GBUV71000779_I_AM_ARROWS_Another Picture Of You_with_P_logo_v2.mov',
        "assetId": '12230',
        "campaignId": '27120900',
        "deliveryTargetService": 'VEVO',
        "revertOperation": False 
        }
    
        videoISRC = "GBUV71000779" # I am Arrows
        
        data = testData.dataset("s_list_of_webservices.tsv")[0]
            
        hub_status_config_url = testData.field(data, "get_delivery_config_get_url")
        create_delivery_url = testData.field(data, "create_save_delivery_using_post_url")
        get_delivery_status_url = testData.field(data, "get_delivery_status_url")
        manifest_parse_success_replace_failure = "vevo_status\\parse_success_replace_failure\\status-manifest.xml"
        manifest_parse_success = "vevo_status\\parse_success\\status-manifest.xml"
        #manifest_parse_failure = findFile("testdata", "vevo_status\\parse_failure\\status-manifest.xml")
        #manifest_parse_success_replace_failure = findFile("testdata", "vevo_status\\parse_success_replace_failure\\status-manifest.xml")
        
        test.log("manifest_parse_success : " + manifest_parse_success)
        test.log("manifest_parse_success_replace_failure : " + manifest_parse_success_replace_failure)
        '''t01 ftp connection login details'''
        ftp_vevo_host = "ftp.uk.mirriad.com"
        ftp_vevo_user = "******"
        ftp_vevo_password = "******"
        ftp_vevo_port = 21
        ftp_vevo_vevo_user = "******"
        
        x = None
        count = 2 # using count for FTP to transfer the status-manifest file as a trigger
        delivery_id = None
        initial_failure = False
        delivery_stage = None
        source(findFile("scripts", "create_delivery.py"))
        
        delivery_id = create_delivery_first_step(create_delivery_data_success, videoISRC, hub_status_config_url, create_delivery_url, get_delivery_status_url, manifest_parse_success, manifest_parse_success_replace_failure, count, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password)
        squish.snooze(60)
        if(delivery_id or delivery_id != None):
            source(findFile("scripts", "deliverywebservices.py"))
            #wait for 30 seconds here because delivery stage = waiting on confirmation
            squish.snooze(60)
            delivery_stage = check_delivery_status(get_delivery_status_url, delivery_id)
        else:
            test.log("Initial Delivery Failed")
            initial_failure = True
        
        if(delivery_stage == "FAILED" and initial_failure == False):
            test.passes("parse_success_replace_failure is successful")
        else:
            test.fail("parse_success_replace_failure delivery has failed, deliveryStage : ")
    except Exception as e:
        print e
        s = str(e)
        print sys.exc_info()
        test.log(s)
        test.fail("parse_success_replace_failure has failed due to :" + s)
        testdata = testData.create("shared", "status.failed")
        try:
            with open(testdata, "w+") as f:
                test.log("Failed so create a status file")  
        except Exception as e:
            print e
            s = str(e)
            test.log(s)