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

chore: support windows on otf template #33

Merged
merged 1 commit into from Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 22 additions & 2 deletions templates/java/TestingFramework/README.md
Expand Up @@ -68,14 +68,34 @@ Prerequisites:
* Have java installed
* Have maven installed
* Build the template `mvn clean verify`
* Download the latest nucleus `curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip > greengrass-nucleus-latest.zip`
* Note down the path of the zip in your file system (you'll need it below)
* Download the latest nucleus
* On Linux Distros `curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip > greengrass-nucleus-latest.zip`
* On Windows Powershell `iwr -Uri "https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip" -OutFile "greengrass-nucleus-latest.zip"`
* Note down the path of the zip in your file system (you'll need it below)


From the root of the project run (make sure to replace the values)

**On Linux Distros**

`java -Dggc.archive=<path-to-nucleus-zip> -Dtest.log.path=./results -Dtags=Sample -jar ./uat/target/ComponentUATs-1.0.0-SNAPSHOT.jar`

**On Windows**

Before you can run the tests on windows you first have to Configure user credentials for Windows devices

* Download the [psexec utility](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec)

* Create user in the LocalSystem account on the Windows device. Run the commands below and replace user-name with the same name of your current system user (output from the previous command) and password with a secure password.
* Run `net user user-name password /ADD`
* Run `psexec -s cmd /c cmdkey /generic:user-name /user:user-name /pass:password`
Comment on lines +87 to +91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be needed for OTF to work. OTF does not run the Nucleus as the SYSTEM user unless I'm mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I had to do this for it to work and I am using otf as a dependency on and ec2 windows machine



Finally run the test with

`java -"Dggc.archive"=<path-to-nucleus-zip> -D"test.log.path"=.\results -Dtags=Sample -jar .\uat\target\ComponentUATs-1.0.0-SNAPSHOT.jar`



### Making changes

Expand Down
2 changes: 1 addition & 1 deletion templates/java/TestingFramework/uat/pom.xml
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>com.aws.greengrass</groupId>
<artifactId>aws-greengrass-testing-standalone</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down