![](/img/trans.png)
[英]How can I create a application to login into another website with no API
[英]How do I create a job in Rundeck to test a website login?
我是 Rundeck 的初学者,我想创建一个工作来测试特定网站的登录。 我怎么做?
您可以使用 CURL 调用站点 API 的内联脚本步骤创建作业。
例如,要针对 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/
以及作业定义,您可以将其复制并保存为 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.