Autosys 作业测试
我是 autosys 的新手..有谁知道如何对特定工作进行积极和消极测试
I am new to autosys.. does anyone know how to perform positive and negative test on particluar job
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Autosys 似乎受到了痛苦的限制。您可以在 JOB2 中创建一个取决于 JOB1 成功的条件,例如 SUCCESS(JOB1)。但似乎不支持与成功相反的条件。 Autosys 提供了 RUNNING 和 NOTRUNNING 条件,但由于某种原因,他们遗憾地忽略了 NOTSUCCESS。
到目前为止,我想出的最佳解决方法是使用以下 JIL 配置:
因此,如果 JOB1 在午夜到早上 7 点之间进入状态“SUCCESS”,则 ACT_ON_THE_CONDITION 将立即运行。由于该命令只是对“date”的虚拟调用,因此应该立即运行并变为“SUCCESS”,因此 0AM-7AM_BOX 框也将变为“SUCCESS”。
另一种可能性是 JOB3 在上午 7 点之前没有进入状态“SUCCESS”。在这种情况下,“term_run_time”设置将导致该框进入“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:
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,
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).
不确定你想测试什么。首先获取您想要在 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.