Silent Update OS Dialogs/Automated testing

From MozillaWiki
Jump to: navigation, search

The challenge

If we want to test the Windows service, we need some way to get admin privileges in order to be able to install the service. If the service is already installed on the system, we can use it to install a new version. Otherwise, we need to gain admin privileges. Unfortunately, since Windows does not have something quite equivalent to sudo, so we need to have a way to bootstrap this process in order to get admin privileges.

Proposed solution

We have a starttalos.bat script on our talos machines which is a scheduled task with a config like this:

 <?xml version="1.0" encoding="UTF-16"?>
 <Task version="1.2" xmlns="">
     <Principal id="Author">
   <Actions Context="Author">

This allows the script to run in privileged mode without the need for somebody to click the UAC dialog. Using a similar mechanism, we could install a known good copy of the service when the machine boots up, and when we're ready to run the tests, the first test can install the new service binary which comes from the build, and then the later tests can go ahead and use the service. This way we can ignore the problem of anything going wrong as part of our test run, since the next time that the machine boots up, it's going to get the known good version of the service.

The downside is that if we need to install a new good version of the service, it's going to be manual work for RelEng. Since the only thing that the known good service is expected to do is to be able to replace itself with the version of the service coming from the binary, I don't expect this problem happening frequently in practice.

In order to automate the process of delivering new good known versions of the service, we're planning to make the installation script download the binary from a known location within the Mozilla build network. We will also download an installation script to enable us to customize the way that the installation works if we need to.