Autosys 作业测试

发布于 2024-10-24 04:29:15 字数 43 浏览 4 评论 0原文

我是 autosys 的新手..有谁知道如何对特定工作进行积极和消极测试

I am new to autosys.. does anyone know how to perform positive and negative test on particluar job

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南城追梦 2024-10-31 04:29:15

Autosys 似乎受到了痛苦的限制。您可以在 JOB2 中创建一个取决于 JOB1 成功的条件,例如 SUCCESS(JOB1)。但似乎不支持与成功相反的条件。 Autosys 提供了 RUNNING 和 NOTRUNNING 条件,但由于某种原因,他们遗憾地忽略了 NOTSUCCESS。

到目前为止,我想出的最佳解决方法是使用以下 JIL 配置:

insert_job: 0AM-7AM_BOX
job_type: b
start_times: "00:00"
description: "Succeeds if JOB1 succeeds, TERMINATED if JOB1 does not succeed"
term_run_time: 419

insert_job: CHECK_THE_CONDITION
job_type: c
box_name: 0AM-7AM_BOX
command: date
condition: success(JOB1)
description: "Succeeds if JOB1 succeeds"

insert_job: ACT_ON_THE_CONDITION
job_type: c
command: [put the command you want to execute here]
condition: SUCCESS(CHECK_THE_CONDITION)
description: "Run the run between midnight and 7am if the condition is true"

因此,如果 JOB1 在午夜到早上 7 点之间进入状态“SUCCESS”,则 ACT_ON_THE_CONDITION 将立即运行。由于该命令只是对“date”的虚拟调用,因此应该立即运行并变为“SUCCESS”,因此 0AM-7AM_BOX 框也将变为“SUCCESS”。

另一种可能性是 JOB3 在上午 7 点之前没有进入状态“SUCCESS”。在这种情况下,“term_run_time”设置将导致该框进入“TERMINATED”状态。

总结一下,

  1. 如果JOB1成功,0AM-7AM_BOX -> SUCCESS
  2. 如果 JOB1 是除 SUCCESS 以外的任何内容,则 0AM-7AM_BOX -> TERMINATED

这很有用,因为您可以设置相关作业来测试成功条件或终止条件(因为 TERMINATED 是您可以放入条件的有效测试)。

Autosys seems to be painfully limited. You can create a condition in JOB2 that depends on the success of JOB1 e.g. SUCCESS(JOB1). But there seems to be no support for a condition that is the inverse of SUCCESS. Autosys provides a RUNNING and a NOTRUNNING condition, but for some reason they unfortunately omitted to include a NOTSUCCESS.

The best workaround I've come up with so far is to use the following JIL configuration:

insert_job: 0AM-7AM_BOX
job_type: b
start_times: "00:00"
description: "Succeeds if JOB1 succeeds, TERMINATED if JOB1 does not succeed"
term_run_time: 419

insert_job: CHECK_THE_CONDITION
job_type: c
box_name: 0AM-7AM_BOX
command: date
condition: success(JOB1)
description: "Succeeds if JOB1 succeeds"

insert_job: ACT_ON_THE_CONDITION
job_type: c
command: [put the command you want to execute here]
condition: SUCCESS(CHECK_THE_CONDITION)
description: "Run the run between midnight and 7am if the condition is true"

So, if JOB1 enters the state "SUCCESS" between midnight and 7am, then ACT_ON_THE_CONDITION will immediately run. Since the command is just a dummy call to "date" this should run immediately and also become "SUCCESS" and therefore the 0AM-7AM_BOX box will also become "SUCCESS".

The other possibility is that JOB3 does not enter state "SUCCESS" before 7am. In this case, the "term_run_time" setting will cause the box to enter the state "TERMINATED".

Summing up,

  1. If JOB1 is SUCCESS, 0AM-7AM_BOX -> SUCCESS
  2. If JOB1 is anything except SUCCESS, 0AM-7AM_BOX -> TERMINATED

This is useful because you can then set up dependent jobs that test the success condition or the terminated condition (since TERMINATED is a valid test you can put in a condition).

断爱 2024-10-31 04:29:15

不确定你想测试什么。首先获取您想要在 Autosys 之外运行的命令或脚本。作为其中的一部分,测试命令或脚本错误处理。 Autosys 会将 aa 命令的任何零退出代码报告为成功,因此请确保您的脚本在任何错误退出时发出非零退出代码。然后,您可以使用虚拟命令或脚本(例如 sleep 命令)来测试 autosys 作业是否按计划运行。然后您可以使用实时命令或脚本进行测试。

要测试特定作业,积极的测试是,如果您强制启动该作业,它会成功运行,并且 autosys 运行的命令生成的日志表明该命令已成功。对命令作业进行否定测试将取决于正在运行的命令或脚本。更改作业之外的某些内容会使命令或脚本失败。

Not sure what you want to test. First get the command or script you want to run working outside of Autosys. As part of that, test the command or scripts error handling. Autosys will report any zero exit code from a a command as a success, so make sure your script sends out a non-zero exit code on any exit from error. Then you can test that the autosys jobs run on schedule by using dummy commands or scripts, like a sleep command. Then you can test using live command or scripts.

To test a particular job, A positive test would be if you force started the job, it ran to sucess and the logs generated by the command ran by autosys indicated that the command was successfull. To do a negative test for a command job would depend on the comand or script being ran. Change something outside of the job to make the command or script fail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文