Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
aada594f
D
Dak
项目概览
喜羊羊3508
/
Dak
8 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
aada594f
编写于
4月 13, 2019
作者:
J
Joerg Jaspert
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'improve-test-coverage-of-dak' into 'master'
Improve test coverage of dak See merge request ftp-team/dak!121
上级
797bb659
3a11d1e1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
232 addition
and
6 deletion
+232
-6
integration-tests/common
integration-tests/common
+17
-1
integration-tests/tests/0001-basic
integration-tests/tests/0001-basic
+4
-4
integration-tests/tests/0002-basic-c-s
integration-tests/tests/0002-basic-c-s
+180
-0
tests/fixtures/packages/Makefile
tests/fixtures/packages/Makefile
+1
-1
tests/fixtures/packages/package-0.2/debian/changelog
tests/fixtures/packages/package-0.2/debian/changelog
+11
-0
tests/fixtures/packages/package-0.2/debian/compat
tests/fixtures/packages/package-0.2/debian/compat
+1
-0
tests/fixtures/packages/package-0.2/debian/control
tests/fixtures/packages/package-0.2/debian/control
+13
-0
tests/fixtures/packages/package-0.2/debian/package.install
tests/fixtures/packages/package-0.2/debian/package.install
+1
-0
tests/fixtures/packages/package-0.2/debian/rules
tests/fixtures/packages/package-0.2/debian/rules
+3
-0
tests/fixtures/packages/package-0.2/some-file
tests/fixtures/packages/package-0.2/some-file
+1
-0
未找到文件。
integration-tests/common
浏览文件 @
aada594f
...
...
@@ -16,9 +16,25 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
_escape_newline
()
{
echo
"
$1
"
| perl
-pe
's/\n/\\n/g'
}
assert-equal
()
{
if
[[
"
${
2
}
"
!=
"
${
3
}
"
]]
;
then
echo
"E:
${
1
}
returned '
${
2
}
' (expected: '
${
3
}
')"
>
&2
local
actual
=
$(
_escape_newline
"
$2
"
)
expected
=
$(
_escape_newline
"
$3
"
)
echo
"E:
${
1
}
returned '
${
actual
}
' (expected: '
${
expected
}
')"
>
&2
exit
1
fi
}
fixture-package-dir
()
{
packages
=
${
DAK_ROOT
:?
}
/tests/fixtures/packages
echo
"
${
packages
}
"
}
import-fixture-signing-key
()
{
packages
=
$(
fixture-package-dir
)
ln
-sf
${
packages
:?
}
/gpg/pubring.gpg
${
DAKBASE
:?
}
/keyrings/upload-keyring.gpg
dak import-keyring
-U
"%s"
${
DAKBASE
}
/keyrings/upload-keyring.gpg
}
integration-tests/tests/0001-basic
浏览文件 @
aada594f
...
...
@@ -59,10 +59,10 @@ EOF
)
(
packages
=$
{
DAK_ROOT
:?}/
tests
/
fixtures
/
packages
ln
-
sf
${
packages
:?}/
gpg
/
pubring
.
gpg
${
DAKBASE
:?}/
keyrings
/
upload
-
keyring
.
gpg
dak
import
-
keyring
-
U
"%s"
${
DAKBASE
}/
keyrings
/
upload
-
keyring
.
gpg
cp
${
packages
:?}/
nonfree
-
package_
*
${
packages
:?}/
package_
*
${
DAKBASE
}/
tmp
packages
=$
(
fixture
-
package
-
dir
)
import
-
fixture
-
signing
-
key
cp
${
packages
:?}/
nonfree
-
package_
*
${
packages
:?}/
package_
0
.1
*
${
DAKBASE
}/
tmp
dak
process
-
upload
-
d
${
DAKBASE
}/
tmp
--
automatic
)
...
...
integration-tests/tests/0002-basic-c-s
0 → 100755
浏览文件 @
aada594f
#
! /bin/bash
#
#
©
2019
Niels
Thykier
<
niels
@
thykier
.
net
>
#
License
:
GPL
-
2
+
#
#
This
program
is
free
software
;
you
can
redistribute
it
and
/
or
modify
#
it
under
the
terms
of
the
GNU
General
Public
License
as
published
by
#
the
Free
Software
Foundation
;
either
version
2
of
the
License
,
or
#
(
at
your
option
)
any
later
version
.
#
#
This
program
is
distributed
in
the
hope
that
it
will
be
useful
,
#
but
WITHOUT
ANY
WARRANTY
;
without
even
the
implied
warranty
of
#
MERCHANTABILITY
or
FITNESS
FOR
A
PARTICULAR
PURPOSE
.
See
the
#
GNU
General
Public
License
for
more
details
.
#
#
You
should
have
received
a
copy
of
the
GNU
General
Public
License
#
along
with
this
program
.
If
not
,
see
<
https
://
www
.
gnu
.
org
/
licenses
/>.
set
-
e
set
-
u
.
${
DAK_ROOT
:?}/
integration
-
tests
/
common
.
${
DAK_ROOT
:?}/
integration
-
tests
/
setup
import
-
fixture
-
signing
-
key
packages
=$(
fixture
-
package
-
dir
)
#
add
a
unstable
suite
with
amd64
dak
admin
architecture
add
amd64
AMD64
dak
admin
suite
add
unstable
""
codename
=
sid
dak
admin
suite
-
architecture
add
unstable
source
all
amd64
dak
admin
suite
-
component
add
unstable
main
contrib
non
-
free
dak
admin
suite
add
testing
""
codename
=
buster
dak
admin
suite
-
architecture
add
testing
source
all
amd64
dak
admin
suite
-
component
add
testing
main
contrib
non
-
free
assert
-
control
-
suite
-
list
()
{
local
suite
=
"$1"
expected
=
"$2"
actual
=$(
dak
control
-
suite
--
list
=
"${suite}"
)
assert
-
equal
"dak control-suite --list=${suite}"
"${actual}"
"${expected}"
}
(
dak
control
-
overrides
-
s
unstable
-
t
deb
-
a
<<
EOF
package
required
admin
EOF
dak
control
-
overrides
-
s
unstable
-
t
dsc
-
a
<<
EOF
package
admin
EOF
)
(
packages
=$(
fixture
-
package
-
dir
)
import
-
fixture
-
signing
-
key
cp
${
packages
:?}/
package_0
.1
*
${
DAKBASE
}/
tmp
dak
process
-
upload
-
d
${
DAKBASE
}/
tmp
--
automatic
)
#
unstable
should
have
0.1
(
expected
=
"$(cat <<EOF
package 0.1-1 all
package 0.1-1 source
EOF
)"
assert
-
control
-
suite
-
list
unstable
"${expected}"
)
#
testing
should
be
empty
(
expected
=
""
assert
-
control
-
suite
-
list
testing
"${expected}"
)
#
dak
ls
test
just
for
the
sake
for
it
(
expected
=
"$(cat <<EOF
package | 0.1-1 | unstable | source, all
EOF
)"
actual
=$(
dak
ls
-
S
-
s
unstable
package
)
assert
-
equal
"dak ls -S -s unstable -f=control-suite package"
"${actual}"
"${expected}"
)
#
Move
package
0.1
to
testing
(
dak
control
-
suite
--
list
=
unstable
|
dak
control
-
suite
--
add
=
testing
actual
=$(
dak
control
-
suite
--
list
=
testing
)
expected
=$(
dak
control
-
suite
--
list
=
unstable
)
assert
-
equal
"dak control-suite --list=testing"
"${actual}"
"${expected}"
)
(
dak
contents
scan
-
binary
dak
contents
scan
-
source
dak
generate
-
packages
-
sources2
-
s
unstable
dak
contents
generate
-
a
dak
-
master
-
s
unstable
#
TODO
:
make
this
work
in
the
CI
;
needs
GnuPG
key
#
dak
generate
-
release
-
s
unstable
)
(
packages
=$(
fixture
-
package
-
dir
)
import
-
fixture
-
signing
-
key
cp
${
packages
:?}/
package_0
.2
*
${
DAKBASE
}/
tmp
dak
process
-
upload
-
d
${
DAKBASE
}/
tmp
--
automatic
)
#
unstable
currently
has
both
and
control
-
suite
should
confirm
this
(
expected
=
"$(cat <<EOF
package 0.1-1 all
package 0.2-1 all
package 0.1-1 source
package 0.2-1 source
EOF
)"
assert
-
control
-
suite
-
list
unstable
"${expected}"
)
#
testing
should
be
unchanged
(
i
.
e
.
only
have
0.1
)
(
expected
=
"$(cat <<EOF
package 0.1-1 all
package 0.1-1 source
EOF
)"
assert
-
control
-
suite
-
list
testing
"${expected}"
)
#
dak
ls
run
just
for
the
sake
of
it
(
expected
=
"$(cat <<EOF
package | 0.1-1 | unstable | source, all
package | 0.2-1 | unstable | source, all
EOF
)"
actual
=$(
dak
ls
-
S
-
s
unstable
package
)
assert
-
equal
"dak ls -S -s unstable -f=control-suite package"
"${actual}"
"${expected}"
)
#
Clean
up
unstable
(
dak
dominate
)
#
unstable
now
only
has
version
0.2
(
expected
=
"$(cat <<EOF
package 0.2-1 all
package 0.2-1 source
EOF
)"
assert
-
control
-
suite
-
list
unstable
"${expected}"
)
#
testing
still
has
version
0.1
(
expected
=
"$(cat <<EOF
package 0.1-1 all
package 0.1-1 source
EOF
)"
assert
-
control
-
suite
-
list
testing
"${expected}"
)
#
dak
ls
run
just
for
the
sake
of
it
(
expected
=
"$(cat <<EOF
package | 0.2-1 | unstable | source, all
EOF
)"
actual
=$(
dak
ls
-
S
-
s
unstable
package
)
assert
-
equal
"dak ls -S -s unstable -f=control-suite package"
"${actual}"
"${expected}"
)
tests/fixtures/packages/Makefile
浏览文件 @
aada594f
export
GNUPGHOME
=
$(CURDIR)
/gpg
SHELL
=
/bin/bash
TAR
=
linux_42.0 nonfree-package_0.1 package_0.1 package-built-using_0.1
TAR
=
linux_42.0 nonfree-package_0.1 package_0.1 package
_0.2 package
-built-using_0.1
PACKAGES
=
$(TAR)
all
:
packages
...
...
tests/fixtures/packages/package-0.2/debian/changelog
0 → 100644
浏览文件 @
aada594f
package
(
0.2
-
1
)
unstable
;
urgency
=
medium
*
Change
something
--
A
Maintainer
<
maint
@
example
.
com
>
Sat
,
13
Apr
2019
06
:
50
:
19
+
0000
package
(
0.1
-
1
)
unstable
;
urgency
=
low
*
Initial
release
.
--
A
Maintainer
<
maint
@
example
.
com
>
Fri
,
08
Jun
2012
18
:
10
:
01
+
0200
tests/fixtures/packages/package-0.2/debian/compat
0 → 100644
浏览文件 @
aada594f
9
tests/fixtures/packages/package-0.2/debian/control
0 → 100644
浏览文件 @
aada594f
Source: package
Section: misc
Priority: extra
Maintainer: A Maintainer <maint@example.com>
Uploaders: An Uploader <uploader@example.com>
Build-Depends: debhelper (>= 9)
Rules-Requires-Root: no
Package: package
Architecture: all
Depends: ${misc:Depends}
Description: a package
a package
tests/fixtures/packages/package-0.2/debian/package.install
0 → 100644
浏览文件 @
aada594f
some
-
file
usr
/
share
/
apackage
tests/fixtures/packages/package-0.2/debian/rules
0 → 100755
浏览文件 @
aada594f
#! /usr/bin/make -f
%:
dh $@
tests/fixtures/packages/package-0.2/some-file
0 → 100644
浏览文件 @
aada594f
some-text
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录