Skip to content

Commit

Permalink
fixup! tests: add tests for compose+add files
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppe committed Apr 27, 2016
1 parent 6b99abd commit 4ccea7b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
1 change: 0 additions & 1 deletion Makefile-tests.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ installed_test_data = tests/libtest.sh \
tests/compose/test-repo.repo \
tests/compose/test-repo.json \
tests/compose/test-repo-add-files.json \
tests/compose/exported_file \
tests/compose/test-repo.repo.in \
$(NULL)

Expand Down
1 change: 0 additions & 1 deletion tests/compose/exported_file

This file was deleted.

2 changes: 0 additions & 2 deletions tests/compose/test-repo-add-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

"repos": ["test-repo"],

"bootstrap_packages": [],

"selinux": false,

"packages": ["empty"],
Expand Down
22 changes: 20 additions & 2 deletions tests/test-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,31 @@ assert_file_has_content refs.txt fedora/test

echo "ok compose"

rpm-ostree --repo=repo compose tree $SRCDIR/test-repo-add-files.json
# bring them in the current context so we can modify exported_file
ln -s $SRCDIR/test-repo-add-files.json .
ln -s $SRCDIR/test-repo.repo .

echo hello > exported_file

rpm-ostree --repo=repo compose tree --touch-if-changed=$(pwd)/touched test-repo-add-files.json
assert_has_file touched
old_mtime=$(stat -c %y touched)
ostree --repo=repo ls fedora/test /exports/exported_file | grep exported > exported.txt

assert_file_has_content exported.txt "/exports/exported_file"
assert_file_has_content exported.txt "0 0"
ostree --repo=repo rev-parse fedora/test > oldref.txt
rpm-ostree --repo=repo compose tree $SRCDIR/test-repo-add-files.json
rpm-ostree --repo=repo compose tree --touch-if-changed=$(pwd)/touched test-repo-add-files.json
new_mtime=$(stat -c %y touched)
ostree --repo=repo rev-parse fedora/test > newref.txt
assert_streq $(cat oldref.txt) $(cat newref.txt)
assert_streq "$old_mtime" "$new_mtime"

echo . >> exported_file
rpm-ostree --repo=repo compose tree --touch-if-changed=$(pwd)/touched test-repo-add-files.json
new_mtime=$(stat -c %y touched)
ostree --repo=repo rev-parse fedora/test > newref.txt
assert_not_streq $(cat oldref.txt) $(cat newref.txt)
assert_not_streq "$old_mtime" "$new_mtime"

echo "ok compose add files"

0 comments on commit 4ccea7b

Please sign in to comment.