-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
176 lines (100 loc) · 4.26 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
NAME
Test::Rsyslog - Creates a temporary instance of rsyslog to run tests
against
VERSION
Version 0.07
SYNOPSIS
my $rsyslog = Test::Rsyslog->new();
Sys::Syslog::setlogsock({ type => 'unix', path => $rsyslog->socket_path() });
# or "Sys::Syslog::setlogsock('unix', $rsyslog->socket_path());" for older Sys::Syslogs
Sys::Syslog::openlog('program[' . $$ . ']','cons','LOG_LOCAL7');
Sys::Syslog::syslog('info|LOG_LOCAL7','This is a test message');
Sys::Syslog::closelog();
ok($rsyslog->find('This is a test message'), 'Rsyslog is okay');
DESCRIPTION
This module allows easy creation and tear down of a rsyslog instance.
When the variable goes out of scope, the rsyslog instance is torn down
and the file system objects it relies on are removed.
SUBROUTINES/METHODS
new
This method will setup and start the rsyslog instance. It currently has
no parameters, but this may change in response to feature requests
socket_path
This method returns that path to the UNIX file system socket that is
connected to the current running instance of rsyslog
find($string)
This method searches the existing logs that rsyslog has processed to
see if a message has been found matching $string. It will return a list
of every line in the log file that matches $string.
start
This method starts the rsyslog instance
stop
This method stops the rsyslog instance
alive
This method checks to make sure that the rsyslogd instance is still
running
messages
This method returns the content of the rsyslogd log file
scrub
This method truncates the rsyslogd log file. Rsyslogd must be stopped
to truncate the log file
DIAGNOSTICS
Failed to open %s for reading
There has been a file system error trying to read from the rsyslog
logfile.
Failed to print to %s
There has been a file system error trying to write to the rsyslog
configuration file.
Failed to fork
The operating system was unable to fork a subprocess for use by the
rsyslog daemon.
Failed to rmdir %s
There has been a file system error trying to remove the temporary
directory.
Failed to unlink %s
There has been a file system error trying to unlink a temporary file
Failed to close %s
There has been a file system error trying to close a temporary file
Failed to mkdir %s
There has been a file system error trying to make the temporary
directory
Temporary rsyslog daemon is already running...
The rsyslog daemon has already started
Unable to truncate while rsyslogd is still running
This module will not truncate the messages file while rsyslogd could
still be writing to it
Unable to untaint the directory path
The module generated an unrecognisable temporary path for rsyslogd
CONFIGURATION AND ENVIRONMENT
Test::Rsyslog requires no configuration files or environment variables.
DEPENDENCIES
Test::Rsyslog requires Perl 5.6 or better.
INCOMPATIBILITIES
None reported
BUGS AND LIMITATIONS
Please report any bugs or feature requests to bug-test-rsyslog at
rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Rsyslog. I will be
notified, and then you'll automatically be notified of progress on your
bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Test::Rsyslog
You can also look for information at:
* RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Rsyslog
* AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Test-Rsyslog
* CPAN Ratings
http://cpanratings.perl.org/d/Test-Rsyslog
* Search CPAN
http://search.cpan.org/dist/Test-Rsyslog/
AUTHOR
David Dick, <ddick at cpan.org>
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2022 David Dick.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.