Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Ansible kitchen测试无法在debian上执行源命令_Python_Rspec_Ansible_Ansible Playbook_Test Kitchen - Fatal编程技术网

Python Ansible kitchen测试无法在debian上执行源命令

Python Ansible kitchen测试无法在debian上执行源命令,python,rspec,ansible,ansible-playbook,test-kitchen,Python,Rspec,Ansible,Ansible Playbook,Test Kitchen,我为python编写了一个ansible剧本角色,并尝试使用带有Serverspec/RSpec的kitchen测试对其进行测试。下面的测试是确定我是否能够激活virtualenv。这在CentOS上运行良好,但在Debian Ubuntu上测试失败,并出现错误(检查代码块下方) 错误: 6) Command "source /home/jenkins/virtualenv/pypy3/bin/activate" exit_status should eq 0 Failure/Erro

我为python编写了一个ansible剧本角色,并尝试使用带有Serverspec/RSpec的kitchen测试对其进行测试。下面的测试是确定我是否能够激活virtualenv。这在CentOS上运行良好,但在Debian Ubuntu上测试失败,并出现错误(检查代码块下方)

错误:

 6) Command "source /home/jenkins/virtualenv/pypy3/bin/activate" exit_status should eq 0
    Failure/Error: its(:exit_status) { should eq 0 }

      expected: 0
           got: 127

      (compared using ==)
      /bin/sh -c source\ /home/jenkins/virtualenv/pypy3/bin/activate

    # /tmp/verifier/suites/serverspec/python_spec.rb:22:in `block (3 levels) in <top (required)>'
6)命令“source/home/jenkins/virtualenv/pypy3/bin/activate”退出状态应为0
失败/错误:其(:exit_status){should eq 0}
预期:0
得了:127
(使用==进行比较)
/bin/sh-c source\/home/jenkins/virtualenv/pypy3/bin/activate
#/tmp/verifier/suites/serverspec/python_spec.rb:22:in`block(3层)in'
我的假设


它试图从/bin/sh运行,但基本上无法运行source命令。如何缓解此问题?

能否将呼叫从
更改为
?这应该可以在
bash
sh
中使用

你真是个天才!时期
 6) Command "source /home/jenkins/virtualenv/pypy3/bin/activate" exit_status should eq 0
    Failure/Error: its(:exit_status) { should eq 0 }

      expected: 0
           got: 127

      (compared using ==)
      /bin/sh -c source\ /home/jenkins/virtualenv/pypy3/bin/activate

    # /tmp/verifier/suites/serverspec/python_spec.rb:22:in `block (3 levels) in <top (required)>'