Changeset 3283 for monitoring


Ignore:
Timestamp:
08/06/13 15:06:22 (11 years ago)
Author:
sanmai
Message:
  • Fix test script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • monitoring/plugins/mpi/integration_test.R

    r3282 r3283  
    22#message(getwd());
    33
    4 test_info <-
     4checks_info <-
    55    utils:::read.table("plugins_hosts_services.tab",
    66                       sep       = "\t",
     
    1414
    1515test_results <-
    16     base:::integer(length = base:::nrow(test_info));
     16    base:::integer(length = base:::nrow(checks_info));
    1717test_stdout <-
    18     base:::character(length = base:::nrow(test_info));
     18    base:::character(length = base:::nrow(checks_info));
    1919#test_stderr
    2020#   <- character(length = length(command_line_arguments));
    2121## X- stderr output cannot be caught separately yet due to R implementation issue
    2222
    23 for (test_index in 1L:base:::nrow(test_info))
     23command_lines <-
     24    base:::list();
     25
     26for (test_index in 1L:base:::nrow(checks_info))
    2427{
    2528    base:::message(base:::paste("Running test", test_index));
    2629
    2730    command_line <-
    28         base:::paste(test_info[test_index,]$`file name`, "-h", test_info[test_index,]$`-h`);
     31        base:::paste(checks_info[test_index,]$`file name`, "-h", checks_info[test_index,]$`-h`);
    2932   
    30     if (test_info[test_index,]$`-u` != "") {
     33    if (checks_info[test_index,]$`-u` != "") {
    3134        command_line <-
    3235            base:::c(command_line,
    33                      '-u', test_info[test_index,]$`-u`);
     36                     '-u', checks_info[test_index,]$`-u`);
    3437    }
    35    
    36     browser();
    3738
    3839    test_output <-
     
    4546    if(!base:::is.null(base:::attr(test_output, "status"))) {
    4647        test_results[test_index] <-
    47             base:::as.integer(attr(test_output, "status"));
     48            base:::as.integer(base:::attr(test_output, "status"));
    4849    } else {
    4950        test_results[test_index] <-
     
    5657                      collapse = "\n");
    5758
     59    command_lines <-
     60        c(command_lines, command_line);
     61
    5862    # browser();
    5963}
    6064
     65browser();
     66
    6167test_results_df <-
    62     base:::data.frame(description             = test_info$service,
    63                       command_line            = command_line,
     68    base:::data.frame(description             = checks_info$description,
     69                      command_line            = command_lines,
    6470                      test_results            = test_results,
    6571                      test_stdout             = test_stdout,
    6672                      stringsAsFactors        = FALSE);
     73
     74browser();
    6775
    6876test_results_file_path <-
Note: See TracChangeset for help on using the changeset viewer.