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

shell/cmds: add genfile command #19401

Merged
merged 2 commits into from Jun 8, 2023
Merged

shell/cmds: add genfile command #19401

merged 2 commits into from Jun 8, 2023

Conversation

benpicco
Copy link
Contributor

Contribution description

Often it is quite handy to have a file with a known and easy to inspect content for transmission tests.

This adds a genfile command where a file with set number of rows (blocks) of varying size can be generated.

It is easy to visually identify corruptions to this file patter.

Testing procedure

The command has been added to tests/vfs_default:

> genfile -?
missing argument
usage: genfile [-o <file>] [-b <block size>] [-n num blocks]

> genfile
|000|0000000000000000000000000000000000000000000000000000000000
|001|1111111111111111111111111111111111111111111111111111111111
|002|2222222222222222222222222222222222222222222222222222222222
|003|3333333333333333333333333333333333333333333333333333333333
|004|4444444444444444444444444444444444444444444444444444444444
|005|5555555555555555555555555555555555555555555555555555555555
|006|6666666666666666666666666666666666666666666666666666666666
|007|7777777777777777777777777777777777777777777777777777777777
|008|8888888888888888888888888888888888888888888888888888888888
|009|9999999999999999999999999999999999999999999999999999999999
|010|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|011|bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|012|cccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|013|dddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
|014|eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|015|ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|016|gggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|017|hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
|018|iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|019|jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
|020|kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|021|llllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|022|mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
|023|nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
|024|oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|025|pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
|026|qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
|027|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
|028|ssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
|029|tttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
|030|uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
|031|vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

> genfile -o /nvm0/test.txt

> ls /nvm0
./
../
hello.txt	18 B
test.txt	2048 B
total 2 files

Issues/PRs references

@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 16, 2023
@github-actions github-actions bot added Area: build system Area: Build system Area: sys Area: System Area: tests Area: tests and testing framework labels Mar 16, 2023
@riot-ci
Copy link

riot-ci commented Mar 16, 2023

Murdock results

✔️ PASSED

e2b03af tests/vfs_default: enable genfile command

Success Failures Total Runtime
6933 0 6933 12m:23s

Artifacts

Copy link
Contributor

@Teufelchen1 Teufelchen1 left a comment

Choose a reason for hiding this comment

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

Looks good, only nits.

Side note: The usage of vfs on native is confusing and poorly documented. I did not succeed to properly tests this 🤡

sys/shell/cmds/vfs.c Outdated Show resolved Hide resolved
sys/shell/cmds/vfs.c Show resolved Hide resolved
sys/shell/cmds/vfs.c Outdated Show resolved Hide resolved
sys/shell/cmds/vfs.c Show resolved Hide resolved
@benpicco
Copy link
Contributor Author

benpicco commented Jun 8, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 8, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 2268caa into RIOT-OS:master Jun 8, 2023
25 checks passed
@benpicco benpicco deleted the genfile branch June 8, 2023 21:53
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants