自动化环境搭建2016年8月1日

1. 连接Ubuntu host到网络,更新系统

sudo apt-get update

2. 新建用户cats(密码:cats)

wget http://10.1.8.64/II/auto_test/create_cats.sh
sudo ./create_cats.sh

Note:

Enter new UNIX password:cats

 

 ==========以下操作请在cats用户下完成=========

3. 设置cats 用户sudo时不需要密码

sudo vim /etc/sudoers

在最后一行添加:

catsALL=(ALL)NOPASSWD: ALL

 

4. 设置无密码登陆远程LINUX主机

sudo su cats
ssh-keygen -t  rsa

Enter file in which to save the key(/home/jsmith/.ssh/id_rsa):[Enter key]

Enter passphrase (empty for no passphrase): [Press enter key]

Enter same passphrase again: [Pess enter key]

Your identification has been saved in /home/jsmith/.ssh/id_rsa.

Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub.

The key fingerprint is:33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9

ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

5. 安装git

sudo apt-get install git -y

6. 下载并执行自动安装脚本

wget http://10.1.8.64/II/auto_test/setup_git_1.2.sh
./setup_git_1.2.sh 

7. 配置XML文件的用例部分(stress_darcy.xml and function_darcy.xml)

cd /opt/autotest/qy_auto/server
vim templates/function_darcy.xml

a. 把对应的py脚本以此形式添加到XML里面

  Note:

需要跑多次的用例可以根据需要自定义round的数目

b. 修改脚本路径

压力测试:

/opt/autotest/qy_auto/testcode/testcases/stress

功能测试:

/opt/autotest/qy_auto/testcode/testcases/function

把XML的case_path 修改成脚本的路径

c.  修改device串口号

0332016020168

 

9. 下载网络配置文件:

sudo mkdir /etc/opt/; sudo chmod 0777 / etc/opt/
wget http://10.1.8.64/II/auto_test/qy_android_x1.conf-P / etc/opt/
 

8. 执行测试任务

cd /opt/autotest/qy_auto/serve
python ALTS-0.1.py –t $PATH/xxx.xml

如:cats@host:/opt/qy_auto/server$./ALTS-0.1.py -t templates/function_darcy.xml

 

9. 测试完成后,打开对应的link就可以看到测试数据和log文件

你可能感兴趣的:(工作相关)