Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artif: new Btrfs artifacts #266

Merged
merged 3 commits into from
Aug 24, 2024
Merged

artif: new Btrfs artifacts #266

merged 3 commits into from
Aug 24, 2024

Conversation

mnrkbys
Copy link

@mnrkbys mnrkbys commented Aug 5, 2024

Add new artifacts to collect information of Btrfs subvolumes.

Add new artifacts to collect information of Btrfs subvolumes.
@mnrkbys
Copy link
Author

mnrkbys commented Aug 6, 2024

I don't know why the validation failed.
The verification succeeds in my environment.

> ./uac --validate-artifact artifacts/live_response/storage/btrfs.yaml 
Validating artifact artifacts/live_response/storage/btrfs.yaml
uac: artifact successfully validated.

However, I have noticed that if the newline code is CRLF, the validation fails.
(/mnt/hgfs/git_root/forked/uac/artifacts/live_response/storage/btrfs.yaml is located on VMware workstation host (Windows).)

> ./uac --validate-artifact /mnt/hgfs/git_root/forked/uac/artifacts/live_response/storage/btrfs.yaml 
Validating artifact /mnt/hgfs/git_root/forked/uac/artifacts/live_response/storage/btrfs.yaml
'.c: artifact: invalid property 'artifacts:

artifacts/live_response/storage/btrfs.yaml

> hexdump -C artifacts/live_response/storage/btrfs.yaml | head
00000000  76 65 72 73 69 6f 6e 3a  20 31 2e 30 0a 63 6f 6e  |version: 1.0.con|
00000010  64 69 74 69 6f 6e 3a 20  63 6f 6d 6d 61 6e 64 5f  |dition: command_|
00000020  65 78 69 73 74 73 20 22  62 74 72 66 73 22 0a 6f  |exists "btrfs".o|
00000030  75 74 70 75 74 5f 64 69  72 65 63 74 6f 72 79 3a  |utput_directory:|
00000040  20 2f 6c 69 76 65 5f 72  65 73 70 6f 6e 73 65 2f  | /live_response/|
00000050  73 74 6f 72 61 67 65 0a  61 72 74 69 66 61 63 74  |storage.artifact|
00000060  73 3a 0a 20 20 2d 0a 20  20 20 20 64 65 73 63 72  |s:.  -.    descr|
00000070  69 70 74 69 6f 6e 3a 20  43 6f 6c 6c 65 63 74 20  |iption: Collect |
00000080  74 68 65 20 6c 69 73 74  20 6f 66 20 61 6c 6c 20  |the list of all |
00000090  42 74 72 66 73 20 6d 6f  75 6e 74 70 6f 69 6e 74  |Btrfs mountpoint|

/mnt/hgfs/git_root/forked/uac/artifacts/live_response/storage/btrfs.yaml

> hexdump -C /mnt/hgfs/git_root/forked/uac/artifacts/live_response/storage/btrfs.yaml | head
00000000  76 65 72 73 69 6f 6e 3a  20 31 2e 30 0d 0a 63 6f  |version: 1.0..co|
00000010  6e 64 69 74 69 6f 6e 3a  20 63 6f 6d 6d 61 6e 64  |ndition: command|
00000020  5f 65 78 69 73 74 73 20  22 62 74 72 66 73 22 0d  |_exists "btrfs".|
00000030  0a 6f 75 74 70 75 74 5f  64 69 72 65 63 74 6f 72  |.output_director|
00000040  79 3a 20 2f 6c 69 76 65  5f 72 65 73 70 6f 6e 73  |y: /live_respons|
00000050  65 2f 73 74 6f 72 61 67  65 0d 0a 61 72 74 69 66  |e/storage..artif|
00000060  61 63 74 73 3a 0d 0a 20  20 2d 0d 0a 20 20 20 20  |acts:..  -..    |
00000070  64 65 73 63 72 69 70 74  69 6f 6e 3a 20 43 6f 6c  |description: Col|
00000080  6c 65 63 74 20 74 68 65  20 6c 69 73 74 20 6f 66  |lect the list of|
00000090  20 61 6c 6c 20 42 74 72  66 73 20 6d 6f 75 6e 74  | all Btrfs mount|

Do line feed codes affect validation?

Changed line feed code from CRLF to LF.
Copy link
Owner

@tclahr tclahr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the second from the last commented?

@mnrkbys
Copy link
Author

mnrkbys commented Aug 19, 2024

The commented out artifact is a forget to delete.
Initially I was considering using the “btrfs subvolume show” command to output information on all Btrfs subvolumes.
The commented out artifact did not work well in the openSUSE environment, so I changed it to process only the Btrfs of the mount point.

@tclahr tclahr merged commit 8a0aa0c into tclahr:develop Aug 24, 2024
1 check passed
@mnrkbys mnrkbys deleted the btrfs branch September 3, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants