ruby - 用于链接到文件中部分的内容的 Serverspec 测试语句
问题描述
我有一个文件,内容如下。我需要为端口号编写服务器规范测试文件,因为它属于它们各自的部分,作为产品木偶自动化的一部分。
路径:etc/a.cfg 文件
Global
user abc
group aaa
frontend one
bind 10.1.0.15:80
option tcp
frontend two
bind 10.1.1.25:666
option tcp
frontend three
bind 10.2.2.45:444
option tcp
我需要编写 serverspec 测试,就好像端口 666 退出并且属于前端 2 部分一样。与 444 和 80 端口存在类似的方式并属于它们各自的部分
我已经创建了与检查这些部分是否存在相关的 soe serverspec 测试语句。像 serverspec.rb
# to check frontend one is exst on server/VM for testing
describe file('a.cfg') do
it { is_expected.to contain %r{^frontend one} }
end
类似的方式 bt 我不确定如何编写 serverspec 测试,就好像端口 666 退出并且属于前端 2 部分一样。与 444 和 80 端口存在类似的方式并属于它们各自的部分
请帮助知道 puppet 或 serverspec 的人。
解决方案
推荐阅读
- c++ - 返回 arg_min 和可选的 min_val 的算法
- javascript - 当我加载我的网页时,我得到:“页面显示有问题:0 错误”
- c++ - main.exe - 未找到入口点错误 (C++)
- javascript - React cancel out of Promise on props change
- flutter - 如何在颤动中获得 ping?
- discord.js - discordjs 我的机器人在本地运行时运行正常,但在 heroku 上运行不正常
- sqlite - peewee.OperationalError 运行查询
- azure-devops - 无法将测试与 Azure devops 管道测试中的工作项相关联(Junit 报告)
- javascript - 我想将html表单值传递给按钮上的href标签
- c# - 取消选择 Xamarin 表单列表视图中的选定行