summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* docker-source: Get list of layers without `--raw`Radostin Stoyanov2017-12-181-56/+10
| | | | | | | | | | | | When `skopeo inspect --raw docker://feodra` is used the returned manifest content contains a list with manifests for specific platforms [1] rather than a list with layers. By using `skopeo inpect docker://fedora` the correct manifest content is retrieved and a list with layers is provided. In addition, skopeo handles the difference between schemaVersion 1 and 2. [1] https://docs.docker.com/registry/spec/manifest-v2-2/#manifest-list-field-descriptions
* Add virt-builder sourceRadostin Stoyanov2017-08-281-0/+243
| | | | | | | | | | | | | | | | | | | | Add implementation for virt-builder source which aims to create container root file system from VM image build with virt-builder. Usage examples: $ virt-bootstrap virt-builder://fedora-25 /tmp/foo $ virt-bootstrap virt-builder://ubuntu-16.04 /tmp/bar --root-password secret $ virt-bootstrap virt-builder://fedora-25 /tmp/foo -f qcow2 --idmap 0:1000:10 $ sudo virt-bootstrap virt-builder://fedora-25 /tmp/foo --idmap 0:1000:10 Tests are also introduced along with the implementation. They cover creation of root file system and UID/GID mapping for 'dir' and 'qcow2' output format by mocking the build_image() method to avoid the time consuming call to virt-builder which might also require network connection with function which creates dummy disk image. Setting root password is handled by virt-builder and hence the introduced test only ensures that the password string is passed correctly.
* Set root password with guestfs-pythonRadostin Stoyanov2017-08-282-0/+27
| | | | | | | | Use the python bindings of libguestfs to create additional qcow2 image which has as backing file the last layer (layer-0.qcow2 for FileSource) and insert hashed value of given root password in the /etc/shadow file. Note: This additional qcow2 image is also used to apply UID/GID map.
* Enable UID/GID mapping for qcow2Radostin Stoyanov2017-08-282-0/+33
| | | | | | | | | | | Apply ownership mapping in qcow2 images using libguestfs python bindings. To make this solution more general we introduce function guestfs_walk() which will return the root file system tree of disk image along with UID/GID values. These changes are applied in additional qcow2 disk image using the last layer as backing file. For FileSource this is layer-1.qcow2 with backing file layer-0.qcow2.
* Create qcow2 images with guestfs-pythonRadostin Stoyanov2017-08-281-0/+29
| | | | | | | | | | | | Use the python bindings of libguestfs to create qcow2 image with backing chains to mimic the layers of container image. This commit also changes the behavior of FileSource when 'qcow2' output format is used. Now the string layer-0.qcow2 will be used as name of the output file. This change is applied in the test suite as an update to the function get_image_path().
* DockerSource: Split checksum and layersRadostin Stoyanov2017-08-281-6/+6
| | | | | | | | | | | | The current implementation store in one list: - checksum - checksum type - file path - file size However, the information about checksum and checksum type is only used to verify the content of tarball before it is being extracted. Splitting these into separate lists would allow us to reuse the function untar_layers() with FileSource.
* Add regression testsRadostin Stoyanov2017-08-283-3/+757
| | | | | | These tests aim to verify the output of virt-bootstrap by creating tar archives which contain dummy root file system and call the function bootstrap(). The check the extracted root file system.
* Drop unit testsRadostin Stoyanov2017-08-287-1948/+180
| | | | | | | | | Unit tests were used to ensure that functions and methods work as expected. However, these tests are closely related to the implementation and will result in major changes after some refactoring. To reduce the amount of work needed to add new features or changes to the code most of these tests will be replaced with more abstract form of testing introduced in the following commits.
* Split 'sources' module into filesRadostin Stoyanov2017-08-031-6/+8
| | | | | | | | | | | | | Improve readability by spliting the 'sources' module into separate files. Each file contains only one class. In addition update the mock statements in the unit tests to match these changes. Add recursive-include in MANIFEST.in to include virtBootstrap.sources module. Update the unit tests to match these changes.
* Use explicit importRadostin Stoyanov2017-08-032-21/+29
| | | | | Reduce the number of import statements and improve readability. Update the unit tests to match these changes.
* tests: Remove redundant argumentsRadostin Stoyanov2017-08-031-19/+22
|
* tests: Add unit tests for the "utils" moduleRadostin Stoyanov2017-07-241-0/+699
|
* tests: Add unit tests for "progress" moduleRadostin Stoyanov2017-07-241-0/+112
|
* tests: Add unit tests for FileSourceRadostin Stoyanov2017-07-241-0/+171
|
* tests: Add unit tests for DockerSourceRadostin Stoyanov2017-07-241-0/+602
|
* tests: Add unit tests for 'virt_bootstrap' moduleRadostin Stoyanov2017-07-242-0/+503
|
* tests: Add test suiteRadostin Stoyanov2017-07-241-0/+0