Skip to content

Commit 4deb1d2

Browse files
author
Aron Lander
committed
check_vwmare_api.t: Documented the functions of the script
An attempt (hopefully correct) to document the script's functions a bit better to make it easier for anyone who, in the future, attempts to grasp it. Signed-off-by: Aron Lander <aron.lander@op5.com>
1 parent 2ca5772 commit 4deb1d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/check_vmware_api.t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ BEGIN {
1818
}
1919
}
2020

21+
# The actual execution of the check_vmware plugin
2122
sub run_cmd
2223
{
2324
my @saved_argv = @ARGV;
@@ -42,6 +43,7 @@ sub run_cmd
4243
%ret;
4344
}
4445

46+
# Loads the test data file (SOAP response data + expected reply)
4547
sub load_script
4648
{
4749
my @response_strings = ();
@@ -88,6 +90,7 @@ sub load_script
8890
};
8991
}
9092

93+
# Generates separate responses from the data in the test data file
9194
sub response_series
9295
{
9396
my @responses;
@@ -97,6 +100,8 @@ sub response_series
97100
}
98101
return @responses;
99102
}
103+
104+
# Packages the responses from response_series to HTTP replies
100105
sub new_response
101106
{
102107
my $content = shift;
@@ -105,6 +110,7 @@ sub new_response
105110
return $response;
106111
}
107112

113+
# Function called upon from the File::find module, used to trigger the run_script command
108114
sub process_file {
109115
my $agent = shift @_;
110116
if (-d $_) {
@@ -124,13 +130,15 @@ sub process_file {
124130
}
125131
}
126132

133+
# Triggers the process_file traversion, which in turn triggers the run_script command
127134
sub run_scripts
128135
{
129136
my ($agent, $directory) = @_;
130137
diag "loading test scripts from ${directory}";
131138
find({ wanted => sub { process_file($agent) }, no_chdir => 1 }, $directory);
132139
}
133140

141+
# Builds the command-line for the check_vmware plugin, and calls the run_cmd command, which triggers the check_vmware plugin
134142
sub run_script
135143
{
136144
my $agent = shift;

0 commit comments

Comments
 (0)