Wiki » Testing Process » Testcases »
Windows 11 Virtual Machine Setup with FWD v4 and the Testcase Project¶
- Install virtualbox on Ubuntu (some packages are already installed)
sudo apt install virtualbox virtualbox-qt linux-headers-"$(uname -r)" dkms vde2 de2-cryptcab
- Enable Virtualbox Linux kernel driver (secure boot requires to manually generate and import in MOK manager a key for the process vboxdrv):
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/"
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
sudo mokutil --import MOK.der
- Restart and enable the new validation key in MOK manager before boot.
- Enable Virtualbox driver:
sudo modprobe vboxdrv
- Download and import Windows dev env VM - https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/.
- Install Oracle JDK 8 in a folder without spaces for make to work later (not in the default C:/Program Files)
- Install ant v. 1.10.12 (latest)
- Install bazaar - latest stable standalone installer from http://wiki.bazaar.canonical.com/WindowsDownloads (required by task
ant-native
)
- Install make - required by
ant-native
- Install mingw 64 v4.9.0 - version downloaded from wiki https://proj.goldencode.com/projects/p2j/wiki/Install_C_Compiler_and_Native_Build_Utilities
- Download
libffi-6.dll
zip from Building and Installing libffi on Windows and install it as described in step 7
- Copy
%JAVA_HOME%\lib\jvm.lib
to mingw64\lib\
folder.
- Copy testcases and the active p2j branch folder (later called
ACT_BR
, currently 3821c
) to the VM. Building the code on shared drives doesn't work.
- Make sure ACT_BR\build.xml properties native.jvm.incpath and native.jvm.libpath are properly set
- Add pathToJre\bin\server (containing
jvm.dll
) to system PATH
- Rebuild symlink:
cd testcases
rmdir p2j
mklink /D p2j ..\ACT_BR
- Build the active p2j branch. Note that
gradle all
doesn't work out of the box because the clean
commands in the 3 make
files (in src/native
) fail on Windows, when the files to delete are not present, so they need to be commented out.
cd ACT_BR
gradlew all
- Add some Progress procedures for conversion in
file-cvt-list.txt
as relative paths to project root, each on a new line.
- Build testcases:
cd testcases
ant convert.list jar deploy.prepare
- Install spawner:
cd testcases
install_spawner.cmd
- Update directory.xml:
- start clean by replacing directory.xml with directory.xml.template;
- update
[]
placeholders - defaultOsUser
is User
for Windows 11 Dev VM, spawner
is CODE_FOLDER\testcases\deploy\spawner\spawn.exe, workingDir
is CODE_FOLDER\testcases\deploy\client;
- update
p2j-entry
with a converted procedure;
- replace
fwd
database with tstcasedata
in 4 places.
- Import db schema:
ant import.db.h2
- Install the certificate in the browser by following Install_the_root_CA
- Run the server:
cd testcases/deploy/server
server.cmd -D
Troubleshooting
- After host OS update (Ubuntu workstation), steps 2. to 4. need to be repeated.
- Official Windows virtual machine from Microsoft will eventually ask you to change password when it expires. The pre-existing password is not set. The Microsoft VMs come without password. I.e. there is no password, so just leave the password field blank when you change that.
- After the trial period is over the VM will get shut down automatically on every hour.
- Since Bazaar / Breezy is not set in the VM to work with GCD repos, you will see this warning in the beginning of the build:
Fetching repository name and branch from bzr info...
WARN: Could not find repository name and branch in 'bzr info' output!
WARN: Unable to resolve repository name. Make sure you build from a supported bzr repository location or the property repo is defined in version.properties.
WARN: Unable to resolve branch name. Make sure you build from a supported bzr repository location or the property branch is defined in version.properties.
Fetching revision number from bzr revno...
To fix it, uncomment and update the following lines in version.properties
:
#repo, branch and rev are attempted to be read from code repository if not defined here
#repo=p2j
#branch=trunk
#rev=123456