Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the system-tests #3

Open
Lyamc opened this issue Sep 17, 2022 · 2 comments
Open

Improve the system-tests #3

Lyamc opened this issue Sep 17, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Lyamc
Copy link

Lyamc commented Sep 17, 2022

So I ran the test on Windows, I understand it does the following:

  1. Install a service com.example.echo
  2. Start the service com.example.echo
    2a) The service will execute %service-manager-rs-PATH%\target\debug\system-tests.exe listen 127.0.0.1:0 --log-file %TEMP%\com.example.echo.log
    2b) The system-tests.exe will create a log file next to it called system-tests.exe.log

The problem is the test doesn't check service stopping, restarting or uninstalling the service. I did see a run_test_n where n is a step, not sure how to use it though. Event viewer can be used to check whether the Service was installed/started/stopped/uninstalled.

I also noticed some errors in the Windows Event Log from when I tried to restart the service.

Activation context generation failed for "C:\Build\service-manager-rs\target\debug\system-tests.exe".Error in manifest or policy file "C:\Build\service-manager-rs\target\debug\system-tests.exe.Config" on line 0. Invalid Xml syntax.
@chipsenkbeil chipsenkbeil added the bug Something isn't working label Sep 21, 2022
@chipsenkbeil
Copy link
Owner

Hm, I wonder if this is the design of the windows service used for the test. I know that I'm able to start and stop distant as a service without issue, although there may still be errors in the Windows Event Log.

I tried pulling up the log on my test vm and could not find a reference to my service, though. The tests simply verify that executing the commands do not fail, otherwise the test itself would fail. So this implies that sc.exe is not reporting a failure exit status for stopping or uninstalling the service, which are the final two steps in the test runner.

My knowledge on windows services is fairly limited, so once I got something working for my use case (distant), I moved forward. Would love any PR you'd like to offer to resolve these problems, @Lyamc! 😄

@chipsenkbeil
Copy link
Owner

Oh, and the run_test_n is used to repeat the test n times. By default, it installs, starts, communicates, stops, and uninstalls three times to ensure that a service can be reinstalled properly and still work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants