chaosblade-io / chaosblade

An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)
https://chaosblade.io
Apache License 2.0
5.95k stars 946 forks source link

“blade create file append” 命令的 date 属性无法正常输出系统时间 #1003

Open aisunyongjie opened 7 months ago

aisunyongjie commented 7 months ago

Issue Description

Describe what happened (or what feature you want)

这个功能对于日志打印非常重要,直接关系到日志注入的时间属性的有效性,请帮忙在最新的版本进行修复,猜测应该是版本更新过程中出现了bug,导致日志打印获取系统时间失败

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

1、 执行命令 : blade create file append --filepath=/root/chaosblade/mock.log --content="XCRcJGFiY1wkXCQgIEB7REFURTorJVktJW0tJWQgJUg6JU06JVN9IEVSUk9SIGNiYSBAe1JBTkRPTToxMDAtMjAwfSBhYmMgIG1vY2sgZXhjZXB0aW9u" --enable-base64=true

  1. 在1.3.0 版本的chaosblade 打印输出是 \$\$abc\$\$ 2024-02-19 11:04:24 ERROR cba 110 abc mock exception 是可以获取到系统时间的
  2. 在1.5.0及以上版本的chaosblade 打印输出是 \$\$abc\$\$ $(date "+%Y-%m-%d %H:%M:%S") ERROR cba 110 abc mock exception ,未能获取到 系统时间

Tell us your environment

linux

Anything else we need to know?

问题复现和修复结果反馈 微信:sundongpo002

aisunyongjie commented 7 months ago

测试引用 https://github.com/chaosblade-io/chaosblade-exec-os/pull/45 基于此链接进行测试