pactest: add test case for servers returning 404 with body
Signed-off-by: morganamilo <morganamilo@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
3401f9e142
commit
2e83a52205
2 changed files with 25 additions and 0 deletions
|
@ -173,6 +173,7 @@ pacman_tests = [
|
||||||
'tests/symlink012.py',
|
'tests/symlink012.py',
|
||||||
'tests/symlink020.py',
|
'tests/symlink020.py',
|
||||||
'tests/symlink021.py',
|
'tests/symlink021.py',
|
||||||
|
'tests/sync-failover-404-with-body.py',
|
||||||
'tests/sync-install-assumeinstalled.py',
|
'tests/sync-install-assumeinstalled.py',
|
||||||
'tests/sync-nodepversion01.py',
|
'tests/sync-nodepversion01.py',
|
||||||
'tests/sync-nodepversion02.py',
|
'tests/sync-nodepversion02.py',
|
||||||
|
|
24
test/pacman/tests/sync-failover-404-with-body.py
Normal file
24
test/pacman/tests/sync-failover-404-with-body.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
self.description = "server failover after 404"
|
||||||
|
self.require_capability("curl")
|
||||||
|
|
||||||
|
p1 = pmpkg('pkg')
|
||||||
|
self.addpkg2db('sync', p1)
|
||||||
|
|
||||||
|
url_broke = self.add_simple_http_server({
|
||||||
|
'/{}'.format(p1.filename()): {
|
||||||
|
'code': 404,
|
||||||
|
'body': 'a',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
url_good = self.add_simple_http_server({
|
||||||
|
'/{}'.format(p1.filename()): p1.makepkg_bytes(),
|
||||||
|
})
|
||||||
|
|
||||||
|
self.db['sync'].option['Server'] = [ url_broke, url_good ]
|
||||||
|
self.db['sync'].syncdir = False
|
||||||
|
self.cachepkgs = False
|
||||||
|
|
||||||
|
self.args = '-S pkg'
|
||||||
|
|
||||||
|
self.addrule("PACMAN_RETCODE=0")
|
||||||
|
self.addrule("PKG_EXIST=pkg")
|
Loading…
Add table
Reference in a new issue