# Genesis **Repository Path**: sitar2020/genesis ## Basic Information - **Project Name**: Genesis - **Description**: 基于Python的工业领域CLI自动化测试框架,与Labview的TestStand测试框架相似,是TestStand的Python实现。 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: https://genesis-docs.readthedocs.io/en/latest/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 10 - **Created**: 2020-09-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Genesis - CLI based Automatic Test Framework #### 如果有对CLI(命令行)自动化感兴趣的同学,请注意这个项目。这个项目用一种可视化的方式监督命令发送的全过程。 #### 这个项目基于B/S模式,后台Python3,前台Vue.js,有完整的安装过程,与示例代码,是CLI自动化测试不二之利器。 ![Image](./genesis.gif) #### 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') If print uut.recbuf here, it looks like: >>> print(uut.recbuf) python3 --version Python 3.6.7 [root@genesis ~]# >>> ### 以下是安装全过程: #### 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` 1. Run `cp /opt/genesis/example/example.py /opt/prod/` 2. Run `cp /opt/genesis/example/example_run.py /opt/prod/` 3. Run `cp /opt/genesis/example/__init__.py /opt/prod/` 4. 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`