From 6003764ff54fccc35849edf7806494bbdf62f0f6 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 25 Aug 2014 22:15:21 +0400 Subject: [PATCH] Add more system tests. #96 --- system/t10_task/RunTask1Test_gold | 4 ++-- system/t10_task/RunTask2Test_gold | 22 ++++++++++++++++++ system/t10_task/RunTask3Test_gold | 10 +++++++++ system/t10_task/RunTask4Test/task | 3 +++ system/t10_task/RunTask4Test_gold | 26 ++++++++++++++++++++++ system/t10_task/RunTask5Test_gold | 2 ++ system/t10_task/run.py | 37 +++++++++++++++++++++++++++---- 7 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 system/t10_task/RunTask2Test_gold create mode 100644 system/t10_task/RunTask3Test_gold create mode 100644 system/t10_task/RunTask4Test/task create mode 100644 system/t10_task/RunTask4Test_gold create mode 100644 system/t10_task/RunTask5Test_gold diff --git a/system/t10_task/RunTask1Test_gold b/system/t10_task/RunTask1Test_gold index 57f0cfa7..30358516 100644 --- a/system/t10_task/RunTask1Test_gold +++ b/system/t10_task/RunTask1Test_gold @@ -12,15 +12,15 @@ Local repo [local] successfully added. You can run 'aptly repo add local ...' to add packages to repository. End command output: ------------------------------ -Local repo `local` has been removed. 3) [Running]: repo drop local Begin command output: ---------------------------- +Local repo `local` has been removed. End command output: ------------------------------ -aptly version: 0.8~dev 4) [Running]: version Begin command output: ---------------------------- +aptly version: 0.8~dev End command output: ------------------------------ diff --git a/system/t10_task/RunTask2Test_gold b/system/t10_task/RunTask2Test_gold new file mode 100644 index 00000000..bcdf84ba --- /dev/null +++ b/system/t10_task/RunTask2Test_gold @@ -0,0 +1,22 @@ +1) [Running]: repo list -raw + +Begin command output: ---------------------------- + +End command output: ------------------------------ +2) [Running]: repo create local + +Begin command output: ---------------------------- + +Local repo [local] successfully added. +You can run 'aptly repo add local ...' to add packages to repository. + +End command output: ------------------------------ +3) [Running]: repo list + +Begin command output: ---------------------------- +List of local repos: + * [local] (packages: 0) + +To get more information about local repository, run `aptly repo show `. + +End command output: ------------------------------ diff --git a/system/t10_task/RunTask3Test_gold b/system/t10_task/RunTask3Test_gold new file mode 100644 index 00000000..4a9a64da --- /dev/null +++ b/system/t10_task/RunTask3Test_gold @@ -0,0 +1,10 @@ +1) [Running]: repo show a + +Begin command output: ---------------------------- +ERROR: unable to show: local repo with name a not found + +End command output: ------------------------------ +2) [Skipping]: repo create local +3) [Skipping]: repo list +ERROR: At least one command has reported an error + diff --git a/system/t10_task/RunTask4Test/task b/system/t10_task/RunTask4Test/task new file mode 100644 index 00000000..5baee0af --- /dev/null +++ b/system/t10_task/RunTask4Test/task @@ -0,0 +1,3 @@ +repo list +repo create -distribution="Cool" abc +repo show abc diff --git a/system/t10_task/RunTask4Test_gold b/system/t10_task/RunTask4Test_gold new file mode 100644 index 00000000..31067b4c --- /dev/null +++ b/system/t10_task/RunTask4Test_gold @@ -0,0 +1,26 @@ +Reading file... + +1) [Running]: repo list + +Begin command output: ---------------------------- +No local repositories found, create one with `aptly repo create ...`. + +End command output: ------------------------------ +2) [Running]: repo create -distribution=Cool abc + +Begin command output: ---------------------------- + +Local repo [abc] successfully added. +You can run 'aptly repo add abc ...' to add packages to repository. + +End command output: ------------------------------ +3) [Running]: repo show abc + +Begin command output: ---------------------------- +Name: abc +Comment: +Default Distribution: Cool +Default Component: main +Number of packages: 0 + +End command output: ------------------------------ diff --git a/system/t10_task/RunTask5Test_gold b/system/t10_task/RunTask5Test_gold new file mode 100644 index 00000000..7f5fabdf --- /dev/null +++ b/system/t10_task/RunTask5Test_gold @@ -0,0 +1,2 @@ +ERROR: No such file, not_found + diff --git a/system/t10_task/run.py b/system/t10_task/run.py index 0633ff15..2d7897ec 100644 --- a/system/t10_task/run.py +++ b/system/t10_task/run.py @@ -2,8 +2,37 @@ from lib import BaseTest class RunTask1Test(BaseTest): - """ - output should match - """ + """ + task run: simple commands, 1-word command + """ + runCmd = "aptly task run repo list, repo create local, repo drop local, version" - runCmd = "aptly task run repo list, repo create local, repo drop local, version" + +class RunTask2Test(BaseTest): + """ + task run: commands with args + """ + runCmd = "aptly task run -- repo list -raw, repo create local, repo list" + + +class RunTask3Test(BaseTest): + """ + task run: failure + """ + expectedCode = 1 + runCmd = "aptly task run -- repo show a, repo create local, repo list" + + +class RunTask4Test(BaseTest): + """ + task run: from file + """ + runCmd = "aptly task run -filename=${testfiles}/task" + + +class RunTask5Test(BaseTest): + """ + task run: from file not found + """ + expectedCode = 1 + runCmd = "aptly task run -filename=not_found"