Verified Commit 1c6cb896 authored by ANA MANZANO RODRIGUEZ's avatar ANA MANZANO RODRIGUEZ Committed by Alberto Miranda
Browse files

ADM_set_qos_constraints.c test created

parent 60331baf
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
#include <stdlib.h>
#include <stdio.h>
#include <admire.h>

int
main(int argc, char* argv[]) {

    if(argc != 6) {
        fprintf(stderr, "ERROR: no location provided\n");
        fprintf(stderr,
                "Usage: ADM_set_qos_constraints <REMOTE_IP> <SCOPE> <QOS_CLASS> <ELEMENT_ID> <CLASS_VALUE>\n");
        exit(EXIT_FAILURE);
    }

    int exit_status = EXIT_SUCCESS;
    ADM_server_t server = ADM_server_create("tcp", argv[1]);

    ADM_job_t job;
    ADM_qos_entity_t entity;
    ADM_qos_limit_t limit;
    ADM_return_t ret = ADM_set_qos_constraints(server, job, entity, limit);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout,
                "ADM_set_qos_constraints() remote procedure not completed "
                "successfully\n");
        exit_status = EXIT_FAILURE;
        goto cleanup;
    }

    fprintf(stdout, "ADM_set_qos_constraints() remote procedure completed "
                    "successfully\n");

cleanup:

    ADM_server_destroy(server);
    exit(exit_status);
}
+4 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ list(APPEND examples_c ADM_register_job ADM_cancel_transfer ADM_connect_data_ope
  ADM_deploy_adhoc_storage ADM_finalize_data_operation ADM_get_pending_transfers ADM_get_qos_constraints
  ADM_get_statistics ADM_get_transfer_priority #ADM_link_transfer_to_data_operation
  ADM_register_adhoc_storage ADM_remove_adhoc_storage ADM_remove_job ADM_set_dataset_information
  ADM_set_io_resources)
  ADM_set_io_resources ADM_set_qos_constraints)

  # ADM_in_situ_ops ADM_in_transit_ops not implemented

@@ -74,3 +74,5 @@ add_test(ADM_remove_job_test ADM_remove_job ofi+tcp://127.0.0.1:52000 42)
add_test(ADM_set_dataset_information_test ADM_set_dataset_information ofi+tcp://127.0.0.1:52000 5 info 42)

add_test(ADM_set_io_resources_test ADM_set_io_resources ofi+tcp://127.0.0.1:52000 4 resources 42)

add_test(ADM_set_qos_constraints_test ADM_set_qos_constraints ofi+tcp://127.0.0.1:52000 dataset bandwith 7 iops)
 No newline at end of file