#15 escaped string passing as argument to command is working badly
Closed 5 years ago Opened 5 years ago by tdudlak.

Some of our tests are failing because of how pytest-multihost parses the command input.

command:

chronyd -Q "pool 2.fedora.pool.ntp.org iburst"

is the actual command, pytest multihost receives it as argument:

["chronyd", "-Q", '"pool 2.fedora.pool.ntp.org iburst"']

and becomes wrong

chronyd -Q \"server pool 2.fedora.pool.ntp.org iburst\"

resulting into:
2018-04-16T13:48:58Z chronyd version 3.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
2018-04-16T13:48:58Z Fatal error : Invalid command at line 1


Please use ["chronyd", "-Q", "pool 2.fedora.pool.ntp.org iburst"] if you don't want the " in the argument passed.

Thank you i will definitelly try, just to be clear we are using '' because of formating
'"pool {} iburst"'.format(serverpool)

Metadata Update from @tdudlak:
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata