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

*: add tests #12

Closed
22 tasks done
cyphar opened this issue Nov 5, 2016 · 4 comments
Closed
22 tasks done

*: add tests #12

cyphar opened this issue Nov 5, 2016 · 4 comments
Milestone

Comments

@cyphar
Copy link
Member

cyphar commented Nov 5, 2016

Currently all the testing I'm doing is manual, we need to have some actual testing. Namely integration testing (using bats) for the actual umoci tool as well as unit tests for the libraries. Another nice thing would be to have validation testing against the OCI validation tooling.

  • Unit tests.
    • Add tests for unpack: insufficient pathname sanitisation #27, to make sure we don't break the safety of paths.
    • Add tests for all of the CAS interfaces against a blank repository.
    • Add tests for generation of tar stream layers.
    • Add tests for unpacking of layers.
  • Integration tests.
    • Test for unpack: doesn't preserve mtime #1, where we run gomtree after extracting the same manifest twice at different times.
    • Test where we pull an image using skopeo, unpack it and then repack it. Then unpack it again to compare the changes (with gomtree).
    • Tests where we unpack things that have changed type.
    • Tests with symlinks that have unusual values (please save me from bad symlink handling).
    • Tests for umoci config to make sure that we set things correctly. Use jq for the testing. We also might want to run the runtime validator against it too.
      • empty config set doesn't change it
      • workingdir.
      • cmd and entrypoint result in the right process.args.
      • metadata: architecture os
      • metadata: author created history [not really sure how to test this]
      • env is set to the right $HOME?
      • Something about volume but I get the feeling it isn't great.
      • user:group is actually parsed according to /etc/passwd.
        • $HOME.
        • and AdditionalGids are set.
    • Add tests for umoci gc to make sure it actually cleans things properly.
@cyphar cyphar added the todo label Nov 5, 2016
@cyphar cyphar modified the milestones: 0.0.0-beta, 0.0.0 Nov 5, 2016
@cyphar
Copy link
Member Author

cyphar commented Nov 10, 2016

I've been working on this inside https://github.com/cyphar/umoci/tree/add-unit-tests.

@cyphar
Copy link
Member Author

cyphar commented Nov 10, 2016

Unit tests implemented in e928b06.

@cyphar cyphar closed this as completed in 8fb8c81 Nov 12, 2016
@cyphar cyphar reopened this Nov 12, 2016
@cyphar
Copy link
Member Author

cyphar commented Nov 12, 2016

Integration tests implemented in 8fb8c81.

@cyphar
Copy link
Member Author

cyphar commented Nov 12, 2016

There are a ~24 tests. Which is okay for a first pass at testing.

@cyphar cyphar closed this as completed Nov 12, 2016
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

No branches or pull requests

1 participant