autopkgtest 是根据DEP8制定的,本文简单记录下这块的相关用法。
或者还可以参考这个教程 https://hackmd.io/@fourdollars/By26b5au8
debci 环境搭建
为了与线上的环境一致,推荐使用 debci
的方式。
autopkgtest-build-qemu
使用qemu创建相关的镜像:
sudo autopkgtest-build-qemu unstable autopkgtest-unstable.img --mirror=https://mirror.iscas.ac.cn/debian/
--mirror
是根据自己的情况指定相关的mirror,加快速度。那么使用的时候:
autopkgtest gdk-pixbuf -- qemu autopkgtest-unstable.img
其中,gdk-pixbuf是你想测试的package。
使用chroot
sudo autopkgtest --apt-upgrade ./xx.dsc -- schroot sid-riscv64-sbuild
debci (online) backned
1. $ sudo apt install debci autopkgtest lxc lxc-templates
2. sudo adduser YOUR_USERNAME debci
3. sudo debci setup 或者
sudo env debci_mirror=https://mirrors.tuna.tsinghua.edu.cn/debian debci setup(可选)
# 更新源,加速
其中, lxc-templates
尤为关键,否则会报找不到 debian
template的错误。
还有一个快速验证 autopkgtest 的 命令:
sudo autopkgtest-build-lxc debian testing riscv64
sudo autopkgtest file_5.38-4.dsc -- lxc autopkgtest-unstable-riscv64
running:
- 源码:
$ autopkgtest --user debci --output-dir /tmp/output-dir . \
-- lxc --sudo autopkgtest-unstable-amd64
其中.
代表源代码的位置。
- built debian package
autopkgtest --user debci --output-dir /tmp/output-dir \
/path/to/PACKAGE_x.y-z_amd64.changes \
-- lxc --sudo autopkgtest-unstable-amd64
可选 --add-apt-source='deb https://mirror.iscas.ac.cn/debian/ sid main '
- 删除lxc的chroot
sudo lxc-destory autopkgtest-unstable-riscv64
- 查看目前的 lxc chroot:
ls /var/lib/lxc/
autopkgtest-unstable-riscv64
debci riscv64 status
autopkgtest(packaging)的一些用法
warning
在autopkgtest中,原生的warning会被认为FAIL,所以我们在处理这样的情况时(没有warning最好),可以使用
Restrictions: allow-stderr
进行约束解除。
autopkgtest for experimential
这里有一个页面展示了 experimential 的 autopkgtest 的情况 : https://release.debian.org/britney/pseudo-excuses-experimental.html
delete lxc chroot
sudo lxc-destroy -n autopkgtest-unstable-riscv64