File tree 5 files changed +1
-38
lines changed
tests/integration_tests/functional
5 files changed +1
-38
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,6 @@ sudo iptables -I FORWARD 1 -i tap0 -o eth0 -j ACCEPT
134
134
API_SOCKET=" /tmp/firecracker.socket"
135
135
LOGFILE=" ./firecracker.log"
136
136
137
- # Create log file
138
- touch $LOGFILE
139
-
140
137
# Set log file
141
138
curl -X PUT --unix-socket " ${API_SOCKET} " \
142
139
--data " {
Original file line number Diff line number Diff line change @@ -152,15 +152,6 @@ mod tests {
152
152
fn test_init_logger ( ) {
153
153
let default_instance_info = InstanceInfo :: default ( ) ;
154
154
155
- // Error case: initializing logger with invalid pipe returns error.
156
- let desc = LoggerConfig {
157
- log_path : PathBuf :: from ( "not_found_file_log" ) ,
158
- level : LoggerLevel :: Debug ,
159
- show_level : false ,
160
- show_log_origin : false ,
161
- } ;
162
- assert ! ( init_logger( desc, & default_instance_info) . is_err( ) ) ;
163
-
164
155
// Initializing logger with valid pipe is ok.
165
156
let log_file = TempFile :: new ( ) . unwrap ( ) ;
166
157
let desc = LoggerConfig {
Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ mod tests {
43
43
44
44
#[ test]
45
45
fn test_init_metrics ( ) {
46
- // Error case: initializing metrics with invalid pipe returns error.
47
- let desc = MetricsConfig {
48
- metrics_path : PathBuf :: from ( "not_found_file_metrics" ) ,
49
- } ;
50
- assert ! ( init_metrics( desc) . is_err( ) ) ;
51
-
52
46
// Initializing metrics with valid pipe is ok.
53
47
let metrics_file = TempFile :: new ( ) . unwrap ( ) ;
54
48
let desc = MetricsConfig {
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ impl RateLimiterConfig {
172
172
fn open_file_nonblock ( path : & Path ) -> Result < File , std:: io:: Error > {
173
173
OpenOptions :: new ( )
174
174
. custom_flags ( O_NONBLOCK )
175
+ . create ( true )
175
176
. read ( true )
176
177
. write ( true )
177
178
. open ( path)
Original file line number Diff line number Diff line change @@ -112,26 +112,6 @@ def test_error_logs(test_microvm_with_api):
112
112
_test_log_config (microvm = test_microvm_with_api , log_level = "Error" )
113
113
114
114
115
- def test_log_config_failure (test_microvm_with_api ):
116
- """
117
- Check passing invalid FIFOs is detected and reported as an error.
118
- """
119
- microvm = test_microvm_with_api
120
- microvm .spawn (create_logger = False )
121
- microvm .basic_config ()
122
-
123
- response = microvm .logger .put (
124
- log_path = "invalid log fifo" ,
125
- level = "Info" ,
126
- show_level = True ,
127
- show_log_origin = True ,
128
- )
129
- # only works if log level is Debug
130
- microvm .time_api_requests = False
131
- assert microvm .api_session .is_status_bad_request (response .status_code )
132
- assert response .json ()["fault_message" ]
133
-
134
-
135
115
def test_api_requests_logs (test_microvm_with_api ):
136
116
"""
137
117
Test that API requests are logged.
You can’t perform that action at this time.
0 commit comments