[英]How do I create a job in Rundeck to test a website login?
I am a beginner with Rundeck, I would like to create a job to test logins in a specific website.我是 Rundeck 的初学者,我想创建一个工作来测试特定网站的登录。 How do I do that?我怎么做?
You can create a job with an inline script step that calls the site API using CURL.您可以使用 CURL 调用站点 API 的内联脚本步骤创建作业。
For example, to test against rundeck itself you can use the following script inside a rundeck job:例如,要针对 rundeck 本身进行测试,您可以在 rundeck 作业中使用以下脚本:
curl -v -c cookie -b cookie -d j_username=admin -d j_password=admin http://localhost:4440/j_security_check \
-H "Accept: application/json" \
http://localhost:4440/api/38/system/info/
And the job definition, you can copy it and save it as a YAML file, then import it to your project to test.以及作业定义,您可以将其复制并保存为 YAML 文件,然后将其导入到您的项目中进行测试。
- defaultTab: nodes
description: ''
executionEnabled: true
id: 2dc15b18-5b2c-4081-be72-17eb3618d68c
loglevel: INFO
name: Login
nodeFilterEditable: false
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- fileExtension: .sh
interpreterArgsQuoted: false
script: |-
curl -v -c cookie -b cookie -d j_username=admin -d j_password=admin http://localhost:4440/j_security_check \
-H "Accept: application/json" \
http://localhost:4440/api/38/system/info/ | jq
scriptInterpreter: /bin/bash
keepgoing: false
strategy: node-first
uuid: 2dc15b18-5b2c-4081-be72-17eb3618d68c
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.