云原生之使用docker部署TestLink测试平台
一、TestLink介绍
TestLink 是基于web的测试用例管理系统,主要功能是测试用例的创建、管理和执行,并且还提供了一些简单的统计功能。
二、TestLink的特点
- 测试需求管理
- 测试用例管理
- 测试用例对测试需求的覆盖管理
- 测试计划的制定
- 测试用例的执行
- 大量测试数据的度量和统计功能。
- 目前在XLS导入上存在缺陷,但可以使用第三方的“Testlink Convert”工具实现XLS/TXT/XML导入导出。
- 软件特色
- 免费开源
- 邮箱提醒
- 权限控制
- 系统可定制
- 插件支持
- 广泛的技术支持
三、检查docker信息
代码语言:shell复制[root@node ~]# docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
compose: Docker Compose (Docker Inc., v2.6.0)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 112
Server Version: 20.10.17
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc version: v1.1.2-0-ga916309
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-957.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 11.68GiB
Name: node
ID: EIOB:6IAO:NQTR:AJBA:O6KS:SNWP:JEDK:GXBG:55FP:IOSK:WRH3:QOAU
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://sp4mg57h.mirror.aliyuncs.com/
Live Restore Enabled: false
四、创建mariadb容器
1.创建安装目录
代码语言:shell复制mkdir -p /data/testlink/mariadb
2.目录授权
代码语言:shell复制[root@node testlink]# chmod -R 755 /data/testlink/
3.创建网络
代码语言:shell复制[root@node testlink]# docker network create testlink
d5764ed407ae63b7008b27f1100ea2d935524fe9ad688a5bfd0c619919fc387c
4.创建mariadb容器
代码语言:shell复制docker run -d --name mariadb --net testlink --restart=always --privileged=true -e MARIADB_ROOT_PASSWORD=testlink -e MARIADB_USER=testlink -e MARIADB_PASSWORD=testlink -e MARIADB_DATABASE=testlink bitnami/mariadb
5.检查mariadb容器状态
代码语言:shell复制[root@node testlink]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS d15485b61d9f bitnami/mariadb "/opt/bitnami/script…" 50 seconds ago Up 49 seconds 3306/tcp mariadb
五、安装Testlink
1.创建Testlink容器
代码语言:shell复制docker run -d -p 8088:8080 -p 8445:8443 --name testlink --net testlink --restart=always --privileged=true -e TESTLINK_DATABASE_USER=testlink -e TESTLINK_DATABASE_PASSWORD=testlink -e TESTLINK_DATABASE_NAME=testlink bitnami/testlink
2.查看Testlink容器状态
代码语言:shell复制[root@node testlink]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b2fdb57fc44 bitnami/testlink "/opt/bitnami/script…" 9 seconds ago Up 8 seconds 0.0.0.0:8088->8080/tcp, :::8088->8080/tcp, 0.0.0.0:8445->8443/tcp, :::8445->8443/tcp testlink
6e8810ca40de bitnami/mariadb "/opt/bitnami/script…" 46 seconds ago Up 45 seconds 3306/tcp mariadb
3.查看Testlink容器日志
代码语言:shell复制[root@node testlink]# docker logs testlink
testlink 08:51:11.04
testlink 08:51:11.04 Welcome to the Bitnami testlink container
testlink 08:51:11.04 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-testlink
testlink 08:51:11.04 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-testlink/issues
testlink 08:51:11.04
testlink 08:51:11.05 INFO ==> ** Starting TestLink setup **
realpath: /bitnami/apache/conf: No such file or directory
testlink 08:51:11.08 INFO ==> Configuring PHP options
testlink 08:51:11.09 INFO ==> Validating settings in MYSQL_CLIENT_* env vars
testlink 08:51:11.16 INFO ==> Configuring TestLink with settings provided via environment variables
testlink 08:51:11.18 INFO ==> Ensuring TestLink directories exist
testlink 08:51:11.19 INFO ==> Trying to connect to the database server
testlink 08:51:11.47 INFO ==> Persisting TestLink installation
testlink 08:51:11.55 INFO ==> ** TestLink setup finished! **
testlink 08:51:11.56 INFO ==> ** Starting Apache **
[Wed Oct 19 08:51:11.604934 2022] [ssl:warn] [pid 1] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Wed Oct 19 08:51:11.605262 2022] [ssl:warn] [pid 1] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Wed Oct 19 08:51:11.623747 2022] [ssl:warn] [pid 1] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Wed Oct 19 08:51:11.623984 2022] [ssl:warn] [pid 1] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Wed Oct 19 08:51:11.632656 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.52 (Unix) OpenSSL/1.1.1d PHP/7.4.27 configured -- resuming normal operations
[Wed Oct 19 08:51:11.632699 2022] [core:notice] [pid 1] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf -D FOREGROUND'
192.168.3.11 - - [19/Oct/2022:08:51:31 0000] "GET / HTTP/1.1" 200 126
192.168.3.11 - - [19/Oct/2022:08:51:31 0000] "GET /login.php HTTP/1.1" 200 830
192.168.3.11 - - [19/Oct/2022:08:52:23 0000] "-" 408 -
六、登录Testlink
user/bitnami
七、进入Testlink首页
我正在参与2023腾讯技术创作特训营第三期有奖征文,组队打卡瓜分大奖!