diff options
| author | Lucian Musat <george.l.musat@intel.com> | 2015-01-27 18:08:08 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-15 21:58:28 +0000 |
| commit | 6cac3ad6fab8d20da77c5b8a66235396bc89d701 (patch) | |
| tree | 4eb2181508be4e92e53c5d42bf7c5d6893655543 | |
| parent | c0a79410b9ac27c79bd53444567de5546db51d0a (diff) | |
| download | poky-6cac3ad6fab8d20da77c5b8a66235396bc89d701.tar.gz | |
oeqa/smart: Added some new test cases
(From OE-Core rev: 945cdab87ed247524059183e1376923a8655069c)
Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/runtime/smart.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py index 3b49314df7..dba3bd60d7 100644 --- a/meta/lib/oeqa/runtime/smart.py +++ b/meta/lib/oeqa/runtime/smart.py | |||
| @@ -53,12 +53,15 @@ class SmartRepoTest(SmartTest): | |||
| 53 | 53 | ||
| 54 | @classmethod | 54 | @classmethod |
| 55 | def setUpClass(self): | 55 | def setUpClass(self): |
| 56 | self.repolist = [] | ||
| 56 | self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip) | 57 | self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip) |
| 57 | self.repo_server.start() | 58 | self.repo_server.start() |
| 58 | 59 | ||
| 59 | @classmethod | 60 | @classmethod |
| 60 | def tearDownClass(self): | 61 | def tearDownClass(self): |
| 61 | self.repo_server.stop() | 62 | self.repo_server.stop() |
| 63 | for i in self.repolist: | ||
| 64 | oeRuntimeTest.tc.target.run('smart channel -y --remove '+str(i)) | ||
| 62 | 65 | ||
| 63 | def test_smart_channel(self): | 66 | def test_smart_channel(self): |
| 64 | self.smart('channel', 1) | 67 | self.smart('channel', 1) |
| @@ -71,6 +74,7 @@ class SmartRepoTest(SmartTest): | |||
| 71 | for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)): | 74 | for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)): |
| 72 | if arch in pkgarchs: | 75 | if arch in pkgarchs: |
| 73 | self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url)) | 76 | self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url)) |
| 77 | self.repolist.append(arch) | ||
| 74 | self.smart('update') | 78 | self.smart('update') |
| 75 | 79 | ||
| 76 | def test_smart_channel_help(self): | 80 | def test_smart_channel_help(self): |
| @@ -119,3 +123,47 @@ class SmartRepoTest(SmartTest): | |||
| 119 | @skipUnlessPassed('test_smart_install') | 123 | @skipUnlessPassed('test_smart_install') |
| 120 | def test_smart_reinstall(self): | 124 | def test_smart_reinstall(self): |
| 121 | self.smart('reinstall -y psplash-default') | 125 | self.smart('reinstall -y psplash-default') |
| 126 | |||
| 127 | @testcase(727) | ||
| 128 | @skipUnlessPassed('test_smart_channel_add') | ||
| 129 | def test_smart_remote_repo(self): | ||
| 130 | self.smart('update') | ||
| 131 | self.smart('install -y psplash') | ||
| 132 | self.smart('remove -y psplash') | ||
| 133 | |||
| 134 | @testcase(726) | ||
| 135 | def test_smart_local_dir(self): | ||
| 136 | self.target.run('mkdir /tmp/myrpmdir') | ||
| 137 | self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y') | ||
| 138 | self.target.run('cd /tmp/myrpmdir') | ||
| 139 | self.smart('download psplash') | ||
| 140 | output = self.smart('channel --list') | ||
| 141 | for i in output.split("\n"): | ||
| 142 | if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)): | ||
| 143 | self.smart('channel --disable '+str(i)) | ||
| 144 | self.target.run('cd /home/root') | ||
| 145 | self.smart('install psplash') | ||
| 146 | for i in output.split("\n"): | ||
| 147 | if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)): | ||
| 148 | self.smart('channel --enable '+str(i)) | ||
| 149 | self.smart('channel --remove myrpmdir -y') | ||
| 150 | self.target.run("rm -rf /tmp/myrpmdir") | ||
| 151 | |||
| 152 | @testcase(718) | ||
| 153 | def test_smart_add_rpmdir(self): | ||
| 154 | self.target.run('mkdir /tmp/myrpmdir') | ||
| 155 | self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y') | ||
| 156 | self.smart('channel --disable myrpmdir -y') | ||
| 157 | output = self.smart('channel --show myrpmdir') | ||
| 158 | self.assertTrue("disabled = yes" in output, msg="Failed to disable rpm dir") | ||
| 159 | self.smart('channel --enable myrpmdir -y') | ||
| 160 | output = self.smart('channel --show myrpmdir') | ||
| 161 | self.assertFalse("disabled = yes" in output, msg="Failed to enable rpm dir") | ||
| 162 | self.smart('channel --remove myrpmdir -y') | ||
| 163 | self.target.run("rm -rf /tmp/myrpmdir") | ||
| 164 | |||
| 165 | @testcase(731) | ||
| 166 | @skipUnlessPassed('test_smart_channel_add') | ||
| 167 | def test_smart_remove_package(self): | ||
| 168 | self.smart('install -y psplash') | ||
| 169 | self.smart('remove -y psplash') \ No newline at end of file | ||
