tinygo
tinygo copied to clipboard
os/Chown
Add os.Chown()
To design meaningful test cases for chown, I think you would need multiple users with different uids and gids and a user who has permission to change ownership of a file to this, a super user. In my opinion, there are 2 ways to integrate this:
- update the container image for the CI so that there are accounts with said properties
- mocking the file system and permissions
The problem I see with solution 2 is that the implementation of chown relies on the syscall chown, so I wouldn't know how to mock that.
I would appreciate your input on that @rminnich
EDIT: Maybe I am mistaken but as I see it, golang does not do any of the described tests but checks for an error of an invalid gid, maybe this is the way to go here as well?
@deadprogram do you have an opinion on that?
@deadprogram
@rminnich
@leongross can you please rebase this PR against the latest dev? Thanks!
@deadprogram rebase done, but noq quite sure where the runtime panic originates. Do you know anything about this?
@deadprogram @aykevl
@leongross looks like some CI fails on this PR. You probably also need to rebase against latest dev.
The old errors should be fixed except for the ci (failing probably due to https://github.com/tinygo-org/tinygo/issues/4347). Could you review it? @deadprogram
@deadprogram I think this was the last fix now, mind to review?
Thanks for the additions @leongross and too @rminnich and @aykevl for review.
Now squash/merging.