summaryrefslogtreecommitdiffstats
path: root/tests/docker_source.py
Commit message (Collapse)AuthorAgeFilesLines
* docker-source: Support blobs without .tar extRadostin Stoyanov2018-04-281-3/+3
| | | | | | | | | | | | | | Since skopeo v0.1.29 [1] blobs are saved without the .tar extension. This commit changes the docker-source module to handle both cases (with or without .tar extension) [1] commit: projectatomic/skopeo@43acc74 Fix skopeo tests with changes to dir transport The dir transport has been changed to save the blobs without the .tar extension Fixes the skopeo tests failing due to this change Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* tests: fix typoRadostin Stoyanov2018-04-241-1/+1
| | | | Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* Revert "docker-source: Support blobs without .tar ext"Radostin Stoyanov2018-04-241-9/+4
| | | | This reverts commit 6146e9ab5e36ff894b8c95d00a45db6181ad8472.
* tests: docker_source: Update descriptionRadostin Stoyanov2018-04-101-2/+2
| | | | Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* docker-source: Support blobs without .tar extRadostin Stoyanov2018-04-101-4/+9
| | | | | | | | | | | | Since skopeo v0.1.29 blobs are saved without the .tar extension. See commit: projectatomic/skopeo@43acc74 Fix skopeo tests with changes to dir transport The dir transport has been changed to save the blobs without the .tar extension Fixes the skopeo tests failing due to this change Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* tests: docker_source: Remove unused codeRadostin Stoyanov2018-04-101-5/+0
| | | | Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* tests: docker_source: Mock out is_installed()Radostin Stoyanov2018-04-101-0/+2
| | | | | | | | | | Commit b38f588 (source-docker: Show error if skopeo not installed) introduced a check used by Docker-souce to verify that skopeo is installed. However, the unit test cases in TestDockerSource do not aim to ensure that skopeo is installed and therefore this check is redundant. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
* tests: Add empty line at the end of fileRadostin Stoyanov2018-03-011-1/+1
| | | | Resolves pylint: "W292 no newline at end of file"
* 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
* Set root password with guestfs-pythonRadostin Stoyanov2017-08-281-0/+18
| | | | | | | | 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-281-0/+23
| | | | | | | | | | | 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.
* 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-281-3/+240
| | | | | | 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-281-0/+150
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.