如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

测试管理(Test Management)指测试人员所需要的任何的所有东西。测试管理工具用来记录测试执行的结果、计划测试活动以及汇报质量控制活动的情况。在这篇文章中我们会向你介绍如何配置 Zephyr 测试管理工具,它包括了管理测试活动需要的所有东西,不需要单独安装测试活动所需要的应用程序从而降低测试人员不必要的麻烦。一旦你安装完它,你就看可以用它跟踪 bug 和缺陷,和你的团队成员协作项目任务,因为你可以轻松地共享和访问测试过程中多个项目团队的数据。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

 

Zephyr 要求

安装和运行 Zephyr 要求满足以下最低条件。可以根据你的基础设施提高资源。我们会在 64 位 CentOS-7 系统上安装 Zephyr,几乎在所有的 Linux 操作系统中都有可用的 Zephyr 二进制发行版。

注:表格

Zephyr test management tool
Linux OSCentOS Linux 7 (Core), 64-bit 
PackagesJDK 7 或更高 ,  Oracle JDK 6 update没有事先安装的 Tomcat 和 MySQL
RAM4 GB推荐 8 GB
CPU2.0 GHZ 或更高
Hard Disk30 GB , 至少 5GB

安装 Zephyr 要求你有超级用户(root)权限,并确保你已经正确配置了网络的静态 IP ,默认端口必须可用并允许通过防火墙。其中 tomcat 会使用 80/443、 8005、 8009、 8010 端口, Zephyr 内部使用 RTMP 协议的 flex 会使用 443 和 2099 号端口。

 

安装 Java JDK 7

安装 Zephyr 首先需要安装 Java JDK 7,如果你的系统上还没有安装,可以按照下面的方法安装 Java 并设置 JAVA_HOME 环境变量。

输入以下的命令安装 Java JDK 7。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">yum</span><span class="pln"> install java</span><span class="pun">-</span><span class="lit">1.7</span><span class="pun">.</span><span class="lit">0</span><span class="pun">-</span><span class="pln">openjdk</span><span class="pun">-</span><span class="lit">1.7</span><span class="pun">.</span><span class="lit">0.79</span><span class="pun">-</span><span class="lit">2.5</span><span class="pun">.</span><span class="lit">5.2</span><span class="pun">.</span><span class="pln">el7_1</span>
  2. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">yum</span><span class="pln"> install java</span><span class="pun">-</span><span class="lit">1.7</span><span class="pun">.</span><span class="lit">0</span><span class="pun">-</span><span class="pln">openjdk</span><span class="pun">-</span><span class="pln">devel</span><span class="pun">-</span><span class="lit">1.7</span><span class="pun">.</span><span class="lit">0.85</span><span class="pun">-</span><span class="lit">2.6</span><span class="pun">.</span><span class="lit">1.2</span><span class="pun">.</span><span class="pln">el7_1</span><span class="pun">.</span><span class="pln">x86_64</span>

安装完 java 和它的所有依赖后,运行下面的命令设置 JAVA_HOME 环境变量。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">export</span><span class="pln"> JAVA_HOME</span><span class="pun">=</span><span class="str">/usr/</span><span class="pln">java</span><span class="pun">/</span><span class="kwd">default</span>
  2. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="str">/usr/</span><span class="pln">java</span><span class="pun">/</span><span class="kwd">default</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">:</span><span class="pln">$PATH</span>

用下面的命令检查 java 版本以验证安装。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> java </span><span class="pun">–</span><span class="pln">version</span>
  2. <span class="pln">java version </span><span class="str">"1.7.0_79"</span>
  3. <span class="typ">OpenJDK</span><span class="typ">Runtime</span><span class="typ">Environment</span><span class="pun">(</span><span class="pln">rhel</span><span class="pun">-</span><span class="lit">2.5</span><span class="pun">.</span><span class="lit">5.2</span><span class="pun">.</span><span class="pln">el7_1</span><span class="pun">-</span><span class="pln">x86_64 u79</span><span class="pun">-</span><span class="pln">b14</span><span class="pun">)</span>
  4. <span class="typ">OpenJDK</span><span class="lit">64</span><span class="pun">-</span><span class="typ">Bit</span><span class="typ">Server</span><span class="pln"> VM </span><span class="pun">(</span><span class="pln">build </span><span class="lit">24.79</span><span class="pun">-</span><span class="pln">b02</span><span class="pun">,</span><span class="pln"> mixed mode</span><span class="pun">)</span>

输出显示我们已经正确安装了 1.7.0_79 版本的 OpenJDK Java。

 

安装 MySQL 5.6.x

如果的机器上有其它的 MySQL,建议你先卸载它们并安装这个版本,或者升级它们的模式(schemas)到指定的版本。因为 Zephyr 前提要求这个指定的 5.6.x 版本的 MySQL ,要有 root 用户名。

可以按照下面的步骤在 CentOS-7.1 上安装 MySQL 5.6 :

下载 rpm 软件包,它会为安装 MySQL 服务器创建一个 yum 库文件。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">yum</span><span class="pln"> install </span><span class="kwd">wget</span>
  2. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">wget</span><span class="pln"> http</span><span class="pun">:</span><span class="com">//repo.mysql.com/mysql-community-release-el7-5.noarch.rpm</span>

然后用 rpm 命令安装下载下来的 rpm 软件包。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> rpm </span><span class="pun">-</span><span class="pln">ivh mysql</span><span class="pun">-</span><span class="pln">community</span><span class="pun">-</span><span class="pln">release</span><span class="pun">-</span><span class="pln">el7</span><span class="pun">-</span><span class="lit">5.noarch</span><span class="pun">.</span><span class="pln">rpm</span>

安装完这个软件包后你会有两个和 MySQL 相关的新的 yum 库。然后使用 yum 命令安装 MySQL Server 5.6,它会自动安装所有需要的依赖。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">yum</span><span class="pln"> install mysql</span><span class="pun">-</span><span class="pln">server</span>

安装过程完成之后,运行下面的命令启动 mysqld 服务并检查它的状态是否激活。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> service mysqld start</span>
  2. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> service mysqld status</span>

对于全新安装的 MySQL 服务器,MySQL root 用户的密码为空。为了安全起见,我们应该重置 MySQL root 用户的密码。用自动生成的空密码连接到 MySQL 并更改 root 用户密码。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> mysql</span>
  2. <span class="pln">mysql</span><span class="pun">></span><span class="pln"> SET PASSWORD FOR </span><span class="str">'root'</span><span class="pun">@</span><span class="str">'localhost'</span><span class="pun">=</span><span class="pln"> PASSWORD</span><span class="pun">(</span><span class="str">'your_password'</span><span class="pun">);</span>
  3. <span class="pln">mysql</span><span class="pun">></span><span class="pln"> flush privileges</span><span class="pun">;</span>
  4. <span class="pln">mysql</span><span class="pun">></span><span class="pln"> quit</span><span class="pun">;</span>

现在我们需要在 MySQL 默认的配置文件中配置所需的数据库参数。打开 "/etc/" 目录中的文件并按照下面那样更新。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="kwd">vi</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="kwd">my</span><span class="pun">.</span><span class="pln">cnf</span>

  1. <span class="pun">[</span><span class="pln">mysqld</span><span class="pun">]</span>
  2. <span class="pln">datadir</span><span class="pun">=</span><span class="str">/var/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">mysql</span>
  3. <span class="pln">socket</span><span class="pun">=</span><span class="str">/var/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">mysql</span><span class="pun">/</span><span class="pln">mysql</span><span class="pun">.</span><span class="pln">sock</span>
  4. <span class="pln">symbolic</span><span class="pun">-</span><span class="pln">links</span><span class="pun">=</span><span class="lit">0</span>
  5. <span class="pln">sql_mode</span><span class="pun">=</span><span class="pln">NO_ENGINE_SUBSTITUTION</span><span class="pun">,</span><span class="pln">STRICT_TRANS_TABLES</span>
  6. <span class="pln">max_allowed_packet</span><span class="pun">=</span><span class="lit">150M</span>
  7. <span class="pln">max_connections</span><span class="pun">=</span><span class="lit">600</span>
  8. <span class="kwd">default</span><span class="pun">-</span><span class="pln">storage</span><span class="pun">-</span><span class="pln">engine</span><span class="pun">=</span><span class="pln">INNODB</span>
  9. <span class="pln">character</span><span class="pun">-</span><span class="kwd">set</span><span class="pun">-</span><span class="pln">server</span><span class="pun">=</span><span class="pln">utf8</span>
  10. <span class="pln">collation</span><span class="pun">-</span><span class="pln">server</span><span class="pun">=</span><span class="pln">utf8_unicode_ci</span>
  11. <span class="pun">[</span><span class="pln">mysqld_safe</span><span class="pun">]</span>
  12. <span class="pln">log</span><span class="pun">-</span><span class="pln">error</span><span class="pun">=</span><span class="str">/var/</span><span class="pln">log</span><span class="pun">/</span><span class="pln">mysqld</span><span class="pun">.</span><span class="pln">log</span>
  13. <span class="pln">pid</span><span class="pun">-</span><span class="kwd">file</span><span class="pun">=</span><span class="str">/var/</span><span class="pln">run</span><span class="pun">/</span><span class="pln">mysqld</span><span class="pun">/</span><span class="pln">mysqld</span><span class="pun">.</span><span class="pln">pid</span>
  14. <span class="kwd">default</span><span class="pun">-</span><span class="pln">storage</span><span class="pun">-</span><span class="pln">engine</span><span class="pun">=</span><span class="pln">INNODB</span>
  15. <span class="pln">character</span><span class="pun">-</span><span class="kwd">set</span><span class="pun">-</span><span class="pln">server</span><span class="pun">=</span><span class="pln">utf8</span>
  16. <span class="pln">collation</span><span class="pun">-</span><span class="pln">server</span><span class="pun">=</span><span class="pln">utf8_unicode_ci</span>
  17. <span class="pun">[</span><span class="pln">mysql</span><span class="pun">]</span>
  18. <span class="pln">max_allowed_packet </span><span class="pun">=</span><span class="lit">150M</span>
  19. <span class="pun">[</span><span class="pln">mysqldump</span><span class="pun">]</span>
  20. <span class="pln">quick</span>

保存配置文件中的更新并重启 mysql 服务。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pln"> service mysqld restart</span>

 

下载 Zephyr 安装包

我们已经安装完了安装 Zephyr 所需要的软件包。现在我们需要获取 Zephyr 二进制发布包和它的许可证密钥。到 Zephyr 官方下载链接 http://download.yourzephyr.com/linux/download.php 输入你的电子邮件 ID 并点击下载。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

下载 Zephyr

然后确认你的电子邮件地址,你会获得 Zephyr 下载链接和它的许可证密钥链接。点击提供的链接从服务器中选择和你操作系统合适的版本下载二进制安装包以及许可证文件。

我们把它下载到 home 目录并更改它的权限为可执行。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

Zephyr 二进制包

 

开始安装和配置 Zephyr

现在我们通过执行它的二进制安装脚本开始安装 Zephyr。

  1. <span class="pun">[</span><span class="pln">root@centos</span><span class="pun">-</span><span class="lit">007</span><span class="pun">~]#</span><span class="pun">./</span><span class="pln">zephyr_4_7_9213_linux_setup</span><span class="pun">.</span><span class="pln">sh </span><span class="pun">–</span><span class="pln">c</span>

一旦你运行了上面的命令,它会检查是否正确配置了 Java 环境变量。如果配置不正确,你可能会看到类似下面的错误。

  1. <span class="pln">testing JVM </span><span class="kwd">in</span><span class="pun">/</span><span class="pln">usr </span><span class="pun">...</span>
  2. <span class="typ">Starting</span><span class="typ">Installer</span><span class="pun">...</span>
  3. <span class="typ">Error</span><span class="pun">:</span><span class="typ">Either</span><span class="pln"> JDK </span><span class="kwd">is</span><span class="kwd">not</span><span class="pln"> found at expected locations </span><span class="kwd">or</span><span class="pln"> JDK version </span><span class="kwd">is</span><span class="pln"> mismatched</span><span class="pun">.</span>
  4. <span class="typ">Zephyr</span><span class="pln"> requires </span><span class="typ">Oracle</span><span class="typ">Java</span><span class="typ">Development</span><span class="typ">Kit</span><span class="pun">(</span><span class="pln">JDK</span><span class="pun">)</span><span class="pln"> version </span><span class="lit">1.7</span><span class="kwd">or</span><span class="pln"> higher</span><span class="pun">.</span>

如果你正确配置了 Java,它会开始安装 Zephyr 并要求你输入 “o” 继续或者输入 “c” 取消安装。让我们敲击 “o” 并输入回车键开始安装。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

安装 zephyr

下一个选项是检查安装 Zephyr 所有的要求,输入回车进入下一个选项。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

zephyr 要求

输入 “1” 并回车同意许可证协议。

  1. <span class="pln">I accept the terms of </span><span class="kwd">this</span><span class="pln"> license agreement </span><span class="pun">[</span><span class="lit">1</span><span class="pun">],</span><span class="pln"> I </span><span class="kwd">do</span><span class="kwd">not</span><span class="pln"> accept the terms of </span><span class="kwd">this</span><span class="pln"> license agreement </span><span class="pun">[</span><span class="lit">2</span><span class="pun">,</span><span class="typ">Enter</span><span class="pun">]</span>

我们需要选择安装 Zephyr 合适的目标位置以及默认端口,如果你想用默认端口之外的其它端口,也可以在这里配置。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

installation folder

然后自定义 mysql 数据库参数并给出配置文件的正确路径。在这一步你可能看到类似下面的错误。

  1. <span class="typ">Please</span><span class="pln"> update </span><span class="typ">MySQL</span><span class="pln"> configuration</span><span class="pun">.</span><span class="typ">Configuration</span><span class="pln"> parameter max_connection should be at least </span><span class="lit">500</span><span class="pun">(</span><span class="pln">max_connection </span><span class="pun">=</span><span class="lit">500</span><span class="pun">)</span><span class="kwd">and</span><span class="pln"> max_allowed_packet should be at least </span><span class="lit">50MB</span><span class="pun">(</span><span class="pln">max_allowed_packet </span><span class="pun">=</span><span class="lit">50M</span><span class="pun">).</span>

要消除这个错误,你要确保在 mysql 配置文件中正确配置了 "max_connection" 和 "max_allowed_packet" 参数。运行所示的命令连接到数据库确认这些设置。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

连接 mysql

当你正确配置了 mysql 数据库,它会提取配置文件并完成安装。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

配置 mysql

安装过程在你的计算机上成功的安装了 Zephyr 4.7。要启动 Zephyr 桌面,输入 “y” 完成 Zephyr 安装。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

启动 zephyr

 

启动 Zephyr 桌面

打开你的 web 浏览器并用你的本机 IP 地址启动 Zephyr 桌面,你会被导向 Zephyr 桌面。

  1. <span class="pln">http</span><span class="pun">:</span><span class="com">//your_server_IP/zephyr/desktop/</span>

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

Zephyr 桌面

从 Zephyr 仪表盘点击 "Test Manager" 并用默认的用户名和密码 "test.manager" 登录。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

Test Manage 登录

你登录进去后你就可以配置你的管理设置了。根据你的环境选择你想要的设置。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

Test Manage 管理

完成管理设置后保存设置,资源管理和项目配置也类似,然后开始使用 Zephyr 作为你的测试管理工具吧。如图所示在 Department Dashboard Management 中检查和编辑管理设置状态。

如何在 CentOS 7.x 上安装 Zephyr 测试管理工具

zephyr 仪表盘

 

总结

好了! 我们已经在 CentOS 7.1 上安装完了 Zephyr。我们希望你能更加深入了解 Zephyr 测试管理工具,它提供简化测试流程、允许快速访问数据分析、协作工具以及多个项目成员之间交流。如果在你的环境中遇到任何问题,欢迎和我们联系。


via: http://linoxide.com/linux-how-to/setup-zephyr-tool-centos-7-x/

作者:Kashif Siddique 译者:ictlyh 校对:wxy

本文由 LCTT 原创翻译,Linux中国 荣誉推出