1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-06 03:45:28 +01:00

11 Commits

Author SHA1 Message Date
Ruixin Bao
594ce2a1ae unit: add test for encode_to_ostree_ref
Add a unit test to verify that it is not possible for
an image to be hex after encoding, and a tag "latest" will
be appended if the image does not have a valid tag.

Closes: #1181
Approved by: giuseppe
2018-02-14 17:49:37 +00:00
Ruixin Bao
deb87057c5 unit: add unit test for refactored 'system_package' function
A 'high-level' unit test is added that covers basic functionality
check for refactored function '_handle_system_package_files'.

Closes: #1155
Approved by: giuseppe
2018-01-31 14:45:14 +00:00
Ruixin Bao
dfb54df58c syscontainer/unit: refactor writing info into a function
This commit refactors the writing info part from 'do_checkout'
into a function.

Also, because of the above action, two of the local variables
'installed_files_template' and 'rename_files' are also removed

Other than those, an extra error case was added to the except list.

A unit test is added for future regression

Closes: #1155
Approved by: giuseppe
2018-01-31 14:45:14 +00:00
Ruixin Bao
c25101e7db syscontainers/unit: refactor rename files part
This commit refactors the "rename file value substitution" code
section in '_do_checkout' function

There should not be any functional impact with this commit

A unit test is added for future regression

Closes: #1155
Approved by: giuseppe
2018-01-31 14:45:14 +00:00
Ruixin Bao
676ad7cb5f syscontainer: refactor tmpfile cleanup and manifest
This commit contains small refactoring of getting manifest
attributes and refactoring of the "tempfile cleaning during
upgrade" code section in '_do_checkout'

Also, 'has_container_service' local variable is genereated in the
function instead of being passed in as a parameter. This is done
because in the future refactoring we might want to elminate the
usage of local variables related to manifest completly.

A unit test is added to verify getting manifest attribute works
as expected

Closes: #1155
Approved by: giuseppe
2018-01-31 14:45:14 +00:00
Ruixin Bao
c41a3c55b2 syscontainers: refactoring duplicated write config function
This commit contains refactoring for write config in '_do_checkout' function,
this refactoring also removes the duplication of writing config in 'run_once'

There should not be functional impact with this commit.

A unit test is added for future regression

Closes: #1160
Approved by: giuseppe
2018-01-17 09:21:09 +00:00
Ruixin Bao
78340b47c7 syscontainers: refactor handling rootfs into a function
In _do_checkout, we refactor the part for getting rootfs location
into a function.

A todo comment( refactoring 'missing image layer check') is also added
in this commit based on discussions on irc

A unit test is added for future regression

Closes: #1154
Approved by: giuseppe
2018-01-04 15:35:16 +00:00
Ruixin Bao
340a172108 syscontainer: make '_get_remote_location' into static method
This is regression from https://github.com/projectatomic/atomic/pull/1152.

It appears that 'self' is no longer used when '_resolve_remote_path' is moved into
'_get_remote_location'. Thus, '_get_remote_location' is made to be static

Closes: #1154
Approved by: giuseppe
2018-01-04 15:35:16 +00:00
Ruixin Bao
64cc86e7ca syscontainer/unit: add test to test remote refactoring
Made a new class to track all the refactored functions' unit tests
(for future usage)

Added a unit test to test the functionality of the factored out
_get_remote_location function.

Closes: #1152
Approved by: giuseppe
2018-01-03 12:36:16 +00:00
Steve Milner
3fb193345b test: Basic unittest for SystemContainers._get_skopeo_args
Signed-off-by: Steve Milner <smilner@redhat.com>

Closes: #1096
Approved by: giuseppe
2017-09-09 09:17:06 +00:00
Steve Milner
6e1aee7db8 tests: unit tests for system containers container_exec
Closes: #1075
Approved by: ashcrow
2017-08-29 07:11:54 +00:00