-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput.txt
More file actions
380 lines (348 loc) · 13.7 KB
/
output.txt
File metadata and controls
380 lines (348 loc) · 13.7 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
=== Install Required Tools ===
[sudo] password for toor:
Hit:1 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
33 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.43.0-1ubuntu7.3).
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (8.5.0-2ubuntu10.6).
The following additional packages will be installed:
libjq1 libonig5
The following NEW packages will be installed:
bc jq libjq1 libonig5 lsof net-tools
0 upgraded, 6 newly installed, 0 to remove and 33 not upgraded.
Need to get 1,103 kB of archives.
After this operation, 3,842 kB of additional disk space will be used.
Get:1 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 bc amd64 1.07.1-3build1 [110 kB]
Get:2 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 libonig5 amd64 6.9.9-1build1 [188 kB]
Get:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 libjq1 amd64 1.7.1-3build1 [134 kB]
Get:4 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 jq amd64 1.7.1-3build1 [63.6 kB]
Get:5 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 lsof amd64 4.95.0-1build3 [318 kB]
Get:6 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble/main amd64 net-tools amd64 2.10-0.1ubuntu4 [289 kB]
Fetched 1,103 kB in 1s (1,511 kB/s)
Selecting previously unselected package bc.
(Reading database ... 109204 files and directories currently installed.)
Preparing to unpack .../0-bc_1.07.1-3build1_amd64.deb ...
Unpacking bc (1.07.1-3build1) ...
Selecting previously unselected package libonig5:amd64.
Preparing to unpack .../1-libonig5_6.9.9-1build1_amd64.deb ...
Unpacking libonig5:amd64 (6.9.9-1build1) ...
Selecting previously unselected package libjq1:amd64.
Preparing to unpack .../2-libjq1_1.7.1-3build1_amd64.deb ...
Unpacking libjq1:amd64 (1.7.1-3build1) ...
Selecting previously unselected package jq.
Preparing to unpack .../3-jq_1.7.1-3build1_amd64.deb ...
Unpacking jq (1.7.1-3build1) ...
Selecting previously unselected package lsof.
Preparing to unpack .../4-lsof_4.95.0-1build3_amd64.deb ...
Unpacking lsof (4.95.0-1build3) ...
Selecting previously unselected package net-tools.
Preparing to unpack .../5-net-tools_2.10-0.1ubuntu4_amd64.deb ...
Unpacking net-tools (2.10-0.1ubuntu4) ...
Setting up bc (1.07.1-3build1) ...
Setting up libonig5:amd64 (6.9.9-1build1) ...
Setting up libjq1:amd64 (1.7.1-3build1) ...
Setting up jq (1.7.1-3build1) ...
Setting up lsof (4.95.0-1build3) ...
Setting up net-tools (2.10-0.1ubuntu4) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
2026-04-12 16:02:09 - Installing pre-requisites
Hit:1 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20240203).
apt-transport-https is already the newest version (2.7.14build2).
curl is already the newest version (8.5.0-2ubuntu10.6).
gnupg is already the newest version (2.4.4-2ubuntu17.2).
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
2026-04-12 16:02:13 - Repository configured successfully.
2026-04-12 16:02:13 - To install Node.js, run: apt install nodejs -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
nodejs-doc
The following NEW packages will be installed:
nodejs nodejs-doc
0 upgraded, 2 newly installed, 0 to remove and 33 not upgraded.
Need to get 32.8 MB of archives.
After this operation, 198 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_18.x nodistro/main amd64 nodejs amd64 18.20.8-1nodesource1 [32.7 MB]
Get:2 https://deb.nodesource.com/node_18.x nodistro/main amd64 nodejs-doc all 18.20.8-1nodesource1 [113 kB]
Fetched 32.8 MB in 3s (10.6 MB/s)
Selecting previously unselected package nodejs.
(Reading database ... 109392 files and directories currently installed.)
Preparing to unpack .../nodejs_18.20.8-1nodesource1_amd64.deb ...
Unpacking nodejs (18.20.8-1nodesource1) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../nodejs-doc_18.20.8-1nodesource1_all.deb ...
Unpacking nodejs-doc (18.20.8-1nodesource1) ...
Setting up nodejs (18.20.8-1nodesource1) ...
Setting up nodejs-doc (18.20.8-1nodesource1) ...
Processing triggers for man-db (2.12.0-4build2) ...
git version 2.43.0
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libpsl/0.21.2
Release-Date: 2023-12-06
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP UnixSockets zstd
v18.20.8
10.8.2
jq-1.7.1
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
=== Step 1: Set Up Project Structure ===
/home/toor/smoke-test-lab
.
./app
./reports
./tests
=== Step 2: Create a Simple Web Application ===
const http = require('http');
const PORT = 3000;
let appStatus = 'healthy';
const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'application/json');
if (req.url === '/health') {
res.writeHead(200);
res.end(JSON.stringify({ status: 'ok', timestamp: new Date().toISOString() }));
} else if (req.url === '/api/data') {
res.writeHead(200);
res.end(JSON.stringify({ message: 'Data endpoint', version: '1.0.0' }));
} else if (req.url === '/api/status') {
res.writeHead(200);
res.end(JSON.stringify({ status: appStatus, uptime: process.uptime() }));
} else {
res.writeHead(404);
res.end(JSON.stringify({ error: 'Not found' }));
}
});
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
=== Step 3: Create Deployment Script ===
=== Wait for application to start ===
-rwxrwxr-x 1 toor toor 300 Apr 12 16:09 deploy.sh
=== Step 1: Create Smoke Test Script ===
=== Exit with appropriate code ===
-rwxrwxr-x 1 toor toor 3680 Apr 12 16:17 tests/smoke_tests.sh
=== Step 2: Create Complete Smoke Test Implementation ===
-rwxrwxr-x 1 toor toor 2430 Apr 12 16:22 tests/smoke_tests_complete.sh
=== Step 3: Create Failure Notification Script ===
=== Read report and send notification ===
-rwxrwxr-x 1 toor toor 1147 Apr 12 16:25 tests/notify_failure.sh
=== Step 1: Build the Complete Pipeline Script ===
=== Execute pipeline ===
-rwxrwxr-x 1 toor toor 2178 Apr 12 16:31 pipeline.sh
=== Step 2: Create Complete Pipeline Implementation ===
-rwxrwxr-x 1 toor toor 1842 Apr 12 16:35 pipeline_complete.sh
=== Step 1: Test Individual Components ===
Starting deployment...
Deployment completed
Application PID: 7421
{"status":"ok","timestamp":"2026-04-12T16:38:14.217Z"}
Starting smoke tests...
Test 1: Health Endpoint Check
[PASS] Health endpoint returned 200 with ok status
Test 2: API Data Endpoint Check
[PASS] API endpoint returned valid data
Test 3: Response Time Check
[PASS] Response time: 0.001127s (under 2s threshold)
Test 4: Application Status Check
[PASS] Application status is healthy
=== Test Summary ===
Passed: 4
Failed: 0
ALL SMOKE TESTS PASSED
total 4.0K
-rw-rw-r-- 1 toor toor 356 Apr 12 16:38 smoke_test_report_20260412_163815.txt
=== Smoke Test Report ===
Timestamp: Sat Apr 12 16:38:15 UTC 2026
Target: http://localhost:3000
Test 1: Health Endpoint Check
[PASS] Health endpoint returned 200 with ok status
Test 2: API Data Endpoint Check
[PASS] API endpoint returned valid data
Test 3: Response Time Check
[PASS] Response time: 0.001127s (under 2s threshold)
Test 4: Application Status Check
[PASS] Application status is healthy
=== Test Summary ===
Passed: 4
Failed: 0
=== Step 2: Run Complete Pipeline ===
[16:41:06] Starting deployment pipeline
[16:41:06] === Pre-Deployment Checks ===
[16:41:06] Port 3000 is in use, stopping existing process
[16:41:08] Pre-deployment checks passed
[16:41:08] === Deploying Application ===
[16:41:16] Application deployed successfully
[16:41:16] === Running Smoke Tests ===
Starting smoke tests...
Test 1: Health Endpoint Check
[PASS] Health endpoint returned 200 with ok status
Test 2: API Data Endpoint Check
[PASS] API endpoint returned valid data
Test 3: Response Time Check
[PASS] Response time: 0.000992s (under 2s threshold)
Test 4: Application Status Check
[PASS] Application status is healthy
=== Test Summary ===
Passed: 4
Failed: 0
ALL SMOKE TESTS PASSED
[16:41:16] === Processing Results ===
[16:41:16] Pipeline completed successfully
[16:41:06] Starting deployment pipeline
[16:41:06] === Pre-Deployment Checks ===
[16:41:06] Port 3000 is in use, stopping existing process
[16:41:08] Pre-deployment checks passed
[16:41:08] === Deploying Application ===
Starting deployment...
Deployment completed
Application PID: 7518
[16:41:16] Application deployed successfully
[16:41:16] === Running Smoke Tests ===
[16:41:16] === Processing Results ===
Success notification sent
[16:41:16] Pipeline completed successfully
Timestamp: 2026-04-12 16:41:16
Deployment Status: PASSED
Passed Tests: 4
Failed Tests: 0
Report Content:
=== Smoke Test Report ===
Timestamp: Sat Apr 12 16:41:16 UTC 2026
Target: http://localhost:3000
Test 1: Health Endpoint Check
[PASS] Health endpoint returned 200 with ok status
Test 2: API Data Endpoint Check
[PASS] API endpoint returned valid data
Test 3: Response Time Check
[PASS] Response time: 0.000992s (under 2s threshold)
Test 4: Application Status Check
[PASS] Application status is healthy
=== Test Summary ===
Passed: 4
Failed: 0
---
=== Step 3: Test Failure Scenario ===
1
Starting smoke tests...
Test 1: Health Endpoint Check
[FAIL] Health endpoint check failed (HTTP: 000)
Test 2: API Data Endpoint Check
[FAIL] API endpoint returned invalid response
Test 3: Response Time Check
[FAIL] Response time: 0.000189s (exceeds 2s threshold or endpoint unreachable)
Test 4: Application Status Check
[FAIL] Application status check failed
=== Test Summary ===
Passed: 0
Failed: 4
SMOKE TESTS FAILED
Exit code: 1
Failure notification sent
=== Test Summary ===
Passed: 4
Failed: 0
---
Timestamp: 2026-04-12 16:42:05
Deployment Status: FAILED
Passed Tests: 0
Failed Tests: 4
Report Content:
=== Smoke Test Report ===
Timestamp: Sat Apr 12 16:42:05 UTC 2026
Target: http://localhost:3000
Test 1: Health Endpoint Check
[FAIL] Health endpoint check failed (HTTP: 000)
Test 2: API Data Endpoint Check
[FAIL] API endpoint returned invalid response
Test 3: Response Time Check
[FAIL] Response time: 0.000189s (exceeds 2s threshold or endpoint unreachable)
Test 4: Application Status Check
[FAIL] Application status check failed
=== Test Summary ===
Passed: 0
Failed: 4
---
Starting deployment...
Deployment completed
Application PID: 7594
{"status":"ok","timestamp":"2026-04-12T16:42:16.914Z"}
=== Application won't start ===
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 7594 toor 18u IPv6 74192 0t0 TCP *:3000 (LISTEN)
Server running on port 3000
v18.20.8
=== Smoke tests fail ===
7594
* Trying 127.0.0.1:3000...
* Connected to localhost (127.0.0.1) port 3000
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Sat, 12 Apr 2026 16:43:19 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Transfer-Encoding: chunked
<
{"status":"ok","timestamp":"2026-04-12T16:43:19.404Z"}
* Connection #0 to host localhost left intact
tcp6 0 0 :::3000 :::* LISTEN 7594/node
=== Pipeline errors ===
[16:41:06] Starting deployment pipeline
[16:41:06] === Pre-Deployment Checks ===
[16:41:06] Port 3000 is in use, stopping existing process
[16:41:08] Pre-deployment checks passed
[16:41:08] === Deploying Application ===
Starting deployment...
Deployment completed
Application PID: 7518
[16:41:16] Application deployed successfully
[16:41:16] === Running Smoke Tests ===
[16:41:16] === Processing Results ===
Success notification sent
[16:41:16] Pipeline completed successfully
-rwxrwxr-x 1 toor toor 300 Apr 12 16:09 deploy.sh
-rwxrwxr-x 1 toor toor 2178 Apr 12 16:31 pipeline.sh
-rwxrwxr-x 1 toor toor 1842 Apr 12 16:35 pipeline_complete.sh
-rwxrwxr-x 1 toor toor 1147 Apr 12 16:25 tests/notify_failure.sh
-rwxrwxr-x 1 toor toor 3680 Apr 12 16:17 tests/smoke_tests.sh
-rwxrwxr-x 1 toor toor 2430 Apr 12 16:22 tests/smoke_tests_complete.sh
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-3build1).
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
=== Final Project Snapshot ===
./app/server.js
./app.log
./deploy.sh
./pipeline.sh
./pipeline_complete.sh
./reports/notifications.log
./reports/pipeline_20260412_164106.log
./reports/smoke_test_report_20260412_163815.txt
./reports/smoke_test_report_20260412_164116.txt
./reports/smoke_test_report_20260412_164205.txt
./tests/notify_failure.sh
./tests/smoke_tests.sh
./tests/smoke_tests_complete.sh
UID PID PPID C STIME TTY STAT TIME CMD
toor 7594 1 0 16:42 ? Sl 0:00 node app/server.js