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

tests: add spread suite for tar-content plugin #2209

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ suites:
summary: tests of snapcraft's Nil plugin
tests/spread/plugins/scons/:
summary: tests of snapcraft's SCons plugin
tests/spread/plugins/tar-content/:
summary: tests of snapcraft's tar-content plugin
tests/spread/plugins/waf/:
summary: tests of snapcraft's Waf plugin

Expand Down
59 changes: 0 additions & 59 deletions tests/integration/plugins/test_tar_plugin.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: test-package
version: 0.1
name: tar-content-test
version: '1.0'
summary: one line summary
description: a longer description
icon: icon.png

grade: devel
confinement: strict

apps:
tar-content-test:
command: test

build-packages: [gcc, libc6-dev]

parts:
Expand Down
40 changes: 40 additions & 0 deletions tests/spread/plugins/tar-content/stage-test/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
summary: Stage a complex tar-content snap

environment:
SNAP_DIR: ../snaps/tar-content-test

restore: |
cd "$SNAP_DIR"
snapcraft clean
rm -f ./*.snap

execute: |
cd "$SNAP_DIR"
snapcraft

# Verify that expected directories exist
[ -d "stage/dir-simple" ]
[ -d "stage/notopdir" ]
[ -d "stage/onedeepdir" ]
[ -d "stage/destdir1" ]
[ -d "stage/destdir1/destdir2" ]

# Verify that expected files exist
[ -f "stage/flat" ]
[ -f "stage/flatdir/flat2" ]
[ -f "stage/onedeep" ]
[ -f "stage/onedeepdir/onedeep2" ]
[ -f "stage/oneflat" ]
[ -f "stage/top-simple" ]
[ -f "stage/notop" ]
[ -f "stage/parent" ]
[ -f "stage/slash" ]
[ -f "stage/readonly_file" ]
[ -f "stage/destdir1/destdir2/top-simple" ]

# Install the snap and test it
sudo snap install tar-content-test_*.snap --dangerous
[ "$(tar-content-test)" = "tarproject" ]

# Regression test for LP: #1500728
snapcraft pull