diff options
Diffstat (limited to 'web/attachments/350309-check_by_ssh_configfile.patch')
| -rw-r--r-- | web/attachments/350309-check_by_ssh_configfile.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/web/attachments/350309-check_by_ssh_configfile.patch b/web/attachments/350309-check_by_ssh_configfile.patch new file mode 100644 index 0000000..b609165 --- /dev/null +++ b/web/attachments/350309-check_by_ssh_configfile.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | Index: plugins/check_by_ssh.c | ||
| 2 | =================================================================== | ||
| 3 | 189a190 | ||
| 4 | > {"configfile", optional_argument, 0, 'F'}, | ||
| 5 | 201c202 | ||
| 6 | < c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:", longopts, | ||
| 7 | --- | ||
| 8 | > c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:F:", longopts, | ||
| 9 | 308a310,313 | ||
| 10 | > case 'F': /* ssh configfile */ | ||
| 11 | > comm_append("-F"); | ||
| 12 | > comm_append(optarg); | ||
| 13 | > break; | ||
| 14 | 422a428,429 | ||
| 15 | > printf (" %s\n","-F, --configfile"); | ||
| 16 | > printf (" %s\n", _("Tell ssh to use this configfile[optional]")); | ||
| 17 | 463c470 | ||
| 18 | < " [-p port] [-o ssh-option]\n", | ||
| 19 | --- | ||
| 20 | > " [-p port] [-o ssh-option] [-F configfile]\n", | ||
| 21 | Index: plugins/t/check_by_ssh.t | ||
| 22 | =================================================================== | ||
| 23 | 19a20,23 | ||
| 24 | > my $ssh_conf = getTestParameter( "NP_SSH_CONFIGFILE", | ||
| 25 | > "A config file with ssh settings", | ||
| 26 | > "~/.ssh/config"); | ||
| 27 | > | ||
| 28 | 22c26 | ||
| 29 | < plan tests => 40; | ||
| 30 | --- | ||
| 31 | > plan tests => 42; | ||
| 32 | 87a92,97 | ||
| 33 | > $result = NPTest->testCmd( | ||
| 34 | > "./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'" | ||
| 35 | > ); | ||
| 36 | > cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)"); | ||
| 37 | > is($result->output, 'OK - check_by_ssh: Remote command \'exit 0\' returned status 0', "Status text if command returned none (OK)"); | ||
| 38 | > | ||
| 39 | 146d155 | ||
| 40 | < | ||
