HOWTO 调试 teuthology 任务
要调试对 ceph-qa-suite 任务(例如 repair_test.py)的修改,使用 teuthology 目标被锁定,使用
$ ./virtualenv/bin/teuthology-lock --lock-many 1 --owner loic@dachary.org $ ./virtualenv/bin/teuthology-lock --list-targets --owner loic@dachary.org > targets.yaml
并用于使用以下命令运行测试:
./virtualenv/bin/teuthology \ --suite-path $HOME/software/ceph/ceph-qa-suite \ --owner loic@dachary.org \ $HOME/software/ceph/ceph-qa-suite/suites/rados/basic/tasks/repair_test.yaml \ roles.yaml
其中 roles.yaml 将所有角色设置为一个目标
roles
- [mon.0, osd.0, osd.1, osd.2, osd.3, osd.4, client.0]
每次运行都需要安装和卸载所有 Ceph 包,并需要几分钟时间。可以注释掉 repair_test.yaml 的安装部分,并手动安装软件包。
$ cat repair.yaml ... tasks: #- install
- ceph
- repair_test
删除现有的软件包
sudo apt-get remove --purge python-ceph ceph-common librados2 librbd1 ceph-fuse libcephfs1-dbg libcephfs-java libcephfs1 libcephfs-jni ceph-fs-common
将仓库设置为所需的分支(例如 wip-10018-primary-erasure-code-hinfo),由 gitbuilder.cgi 编译,使用
$ echo deb http://gitbuilder.ceph.com/ceph-deb-trusty-x86_64-basic/ref/wip-10018-primary-erasure-code-hinfo trusty main | sudo tee /etc/apt/sources.list.d/ceph.list
安装软件包
$ sudo apt-get update $ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install ceph ceph-dbg ceph-mds ceph-mds-dbg ceph-common ceph-common-dbg ceph-fuse ceph-fuse-dbg ceph-test ceph-test-dbg radosgw radosgw-dbg python-ceph libcephfs1 libcephfs1-dbg libcephfs-java librados2 librados2-dbg librbd1 librbd1-dbg
并清理仓库(必须在每次测试完成后再次执行)
$ rm -fr cephtest/ && sudo rm -fr /var/lib/ceph && sudo rm -fr /var/log/ceph/*
必须使用以下命令从 teuthology 源代码复制实用程序(假设 vpm178 是目标):
$ scp teuthology/task/daemon-helper teuthology/task/adjust-ulimits ubuntu@vpm178:/tmp $ ssh ubuntu@vpm178 sudo cp -a /tmp/{daemon-helper,adjust-ulimits} /usr/bin