1 Star 0 Fork 10

家文 / Genesis

forked from robinwu / kunlun-atp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Genesis - CLI based Automatic Test Framework

如果有对CLI(命令行)自动化感兴趣的同学,请注意这个项目。这个项目用一种可视化的方式监督命令发送的全过程。

这个项目基于B/S模式,后台Python3,前台Vue.js,有完整的安装过程,与示例代码,是CLI自动化测试不二之利器。

Image

Take an Example

Human could manually type commands in Terminal to get the Python version.

[root@genesis ~]# python3 --version
Python 3.6.7
[root@genesis ~]#

Genesis is able to do the exact same thing.

uut = lib.conn.UUT
uut.open()
uut.send('python3 --version\r', expectphrase=']#', timeout=60)
if 'Python 3.6.7' not in uut.recbuf:
    raise Exception('Did not found [Python 3.6.7], go to failure')

以下是安装全过程:

Install CentOS 7

  1. During installation, choose GNOME Desktop & Development Tool
  2. Create Guest account genesis/genesis and set it as administrator

Login CentOS 7 with root

  1. Open a terminal

Install Python3.6

  1. Run yum install -y https://centos7.iuscommunity.org/ius-release.rpm
  2. Run rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm
  3. Run yum install -y python36u python36u-libs python36u-devel python36u-pip
  4. Make sure python3 & pip3 work

Install Redis

  1. Run yum install -y redis

Install Apache

  1. Run yum install -y httpd
  2. Run yum install -y mod_ssl

Noted: later Genesis will re-config apache silently

Disable SELinux

  1. Run vi /etc/selinux/config, set SELINUX=disabled
  2. Reboot CentOS 7 System to take effect

Login CentOS 7 with root again!

  1. Open a terminal

Install Genesis

  1. Run cd /opt
  2. Run git clone https://gitee.com/andrew2015/genesis.git
  3. Run cd /opt/genesis & pip3 install -r requirements.txt
  4. Run cp /opt/genesis/certificate.crt /opt/
  5. Run python3 manage.py makemigrations & python3 manage.py migrate
  6. Run ln -s /opt/genesis/gen.py /usr/bin/gen
  7. Run chmod +x /opt/genesis/gen.py
  8. Run chown -R genesis:genesis /opt

Noted: If you meet any issue above, please raise your hand.

Enjoy Your Time

Change username to genesis from now on.

If you don't have code yet, please use example code:

  1. Run gen -h
  2. Run gen stop
  3. Run cp /opt/genesis/example/example.py /opt/prod/
  4. Run cp /opt/genesis/example/example_run.py /opt/prod/
  5. Run cp /opt/genesis/example/__init__.py /opt/prod/
  6. Run cp /opt/genesis/example/example_config.py /opt/config/

Start Work!

  1. Run gen start
  2. Open Browser - Google Chrome, use address - localhost or ip address
MIT License Copyright (c) 2020 Andrew Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于Python的CLI自动化项目 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/ynjw/genesis.git
git@gitee.com:ynjw/genesis.git
ynjw
genesis
Genesis
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891