You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`capture-output.sh` runs every `ec2-metadata` subcommand and saves each output to a separate file. This lets you compare output before and after a code change to catch regressions.
4
+
5
+
## Usage
6
+
7
+
```bash
8
+
# 1. Capture baseline output (before your changes)
9
+
./capture-output.sh output-before
10
+
11
+
# 2. Make your changes to ec2-metadata
12
+
13
+
# 3. Capture output again
14
+
./capture-output.sh output-after
15
+
16
+
# 4. Compare
17
+
diff -r output-before output-after
18
+
```
19
+
20
+
No diff output means the change is behavior-preserving. Any differences will show exactly which subcommand's output changed and how.
21
+
22
+
## Notes
23
+
24
+
- Must be run on an EC2 instance (requires IMDS access).
25
+
- The subcommand list is derived dynamically from `ec2-metadata --help`, so new options are picked up automatically.
26
+
- Individual subcommand failures are logged as warnings but don't stop the run, so you get partial results even if some metadata categories are unavailable.
0 commit comments