Signed-off-by: Francois Gouget fgouget@codeweavers.com --- 64-bit Windows makes it a pain to perform some tasks from a 32-bit process, such as running bcdedit.exe (it can be worked around by using c:\Windows\SysNative but that depends on the Windows bitness). --- testbot/bin/Janitor.pl | 2 +- testbot/bin/LibvirtTool.pl | 3 ++- testbot/bin/WineRunReconfig.pl | 3 ++- testbot/lib/Build/Utils.pm | 15 +++++++++++---- testbot/src/testagentd/Makefile | 34 +++++++++++++++++++++------------ 5 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl index 1b5bb33c34..ab72ac1b62 100755 --- a/testbot/bin/Janitor.pl +++ b/testbot/bin/Janitor.pl @@ -319,7 +319,7 @@ if (opendir(my $dh, "$DataDir/latest")) # Needed to analyze Wine patches next if ($Entry eq "winefiles.txt" or $Entry eq "wine-parentsrc.txt"); # Needed to update Windows VMs - next if ($Entry eq "TestAgentd.exe"); + next if ($Entry =~ /^TestAgentd(?:32|64).exe$/); # Needed to run the tests next if ($Entry =~ /^TestLauncher(?:32|64).exe$/); next if ($Entry =~ /^winetest(?:64)?-latest.exe$/); diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl index c027d6bd68..00d1ce4f8e 100755 --- a/testbot/bin/LibvirtTool.pl +++ b/testbot/bin/LibvirtTool.pl @@ -619,7 +619,8 @@ sub CreateSnapshot($$$$) FatalError("The $VMKey TestAgent server is too old to be upgraded: $Version\n"); }
- if (!$TA->Upgrade("$DataDir/latest/TestAgentd.exe")) + my $Bits = ($VM->Type =~ /64/) ? "64" : "32"; + if (!$TA->Upgrade("$DataDir/latest/TestAgentd$Bits.exe")) { my $ErrMessage = $TA->GetLastError(); FatalError("Could not upgrade the $VMKey TestAgent: $ErrMessage\n"); diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index b4035cb021..6d6905026e 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -467,7 +467,8 @@ if ($NewStatus eq "completed") if ($VM->Type eq "build") { # Only needed for the Windows VMs and only built by the build VMs. - push @FileNames, "../src/testagentd/TestAgentd.exe"; + push @FileNames, "../src/testagentd/TestAgentd32.exe", + "../src/testagentd/TestAgentd64.exe"; } foreach my $FileName (@FileNames) { diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm index 9d169633e6..9e73cba592 100644 --- a/testbot/lib/Build/Utils.pm +++ b/testbot/lib/Build/Utils.pm @@ -260,8 +260,12 @@ sub BuildNativeTestAgentd()
sub BuildWindowsTestAgentd() { - my $WindowsTestAgentd = "$::RootDir/src/testagentd/TestAgentd.exe"; - my $Before = GetMTime($WindowsTestAgentd); + my %Files; + foreach my $Bits ("32", "64") + { + $Files{"Path$Bits"} = "$::RootDir/src/testagentd/TestAgent$Bits.exe"; + $Files{"Before$Bits"} = GetMTime($Files{"Path$Bits"}); + }
InfoMsg "\nRebuilding the Windows TestAgentd\n"; my $CPUCount = GetCPUCount(); @@ -273,9 +277,12 @@ sub BuildWindowsTestAgentd() return !1; }
- if ($Before != GetMTime($WindowsTestAgentd)) + foreach my $Bits ("32", "64") { - LogMsg "Updated TestAgentd.exe\n"; + if ($Files{"Before$Bits"} != GetMTime($Files{"Path$Bits"})) + { + LogMsg "Updated ". basename($Files{"Path$Bits"}) ."\n"; + } } return 1; } diff --git a/testbot/src/testagentd/Makefile b/testbot/src/testagentd/Makefile index 7808af2a8f..645e268435 100644 --- a/testbot/src/testagentd/Makefile +++ b/testbot/src/testagentd/Makefile @@ -2,10 +2,12 @@ builddir = ../../bin/build
CROSSCC32 = i686-w64-mingw32-gcc CROSSSTRIP32 = i686-w64-mingw32-strip +CROSSCC64 = x86_64-w64-mingw32-gcc +CROSSSTRIP64 = x86_64-w64-mingw32-strip
all: build iso build: $(builddir)/testagentd -windows: TestAgentd.exe +windows: TestAgentd32.exe TestAgentd64.exe
UNIX_SOURCES = testagentd.c platform_unix.c @@ -20,25 +22,33 @@ $(builddir)/testagentd: $(UNIX_SOURCES:.c=.o)
WIN_SOURCES = testagentd.c platform_windows.c
-TestAgentd.exe: $(WIN_SOURCES:.c=.obj) - $(CROSSCC32) -o $@ $(WIN_SOURCES:.c=.obj) -lws2_32 +TestAgentd32.exe: $(WIN_SOURCES:.c=.obj32) + $(CROSSCC32) -o $@ $(WIN_SOURCES:.c=.obj32) -lws2_32 $(CROSSSTRIP32) $@
-.SUFFIXES: .obj -.c.obj: +.SUFFIXES: .obj32 +.c.obj32: $(CROSSCC32) -Wall -g -c -o $@ $<
-testagentd.o testagentd.obj: platform.h -platform_unix.o: platform.h list.h -platform_windows.obj: platform.h list.h +TestAgentd64.exe: $(WIN_SOURCES:.c=.obj64) + $(CROSSCC64) -o $@ $(WIN_SOURCES:.c=.obj64) -lws2_32 + $(CROSSSTRIP64) $@ + +.SUFFIXES: .obj64 +.c.obj64: + $(CROSSCC64) -Wall -g -c -o $@ $<
+testagentd.o testagentd.obj32 testagentd.obj64: platform.h +platform_unix.o: platform.h list.h +platform_windows.obj32 platform_windows.obj64: platform.h list.h + iso: winetestbot.iso
-winetestbot.iso: TestAgentd.exe +winetestbot.iso: windows rm -rf winetest mkdir winetest - cp TestAgentd.exe winetest + cp TestAgentd32.exe TestAgentd64.exe winetest mkisofs="mkisofs"; \ type mkisofs >/dev/null 2>&1 || mkisofs="genisoimage"; \ "$$mkisofs" -quiet -J -r -V "WineTestBot" -input-charset "ascii" -o "winetestbot.iso" winetest @@ -47,6 +57,6 @@ winetestbot.iso: TestAgentd.exe
clean: rm -f $(UNIX_SOURCES:.c=.o) - rm -f $(WIN_SOURCES:.c=.obj) - rm -f TestAgentd.exe + rm -f $(WIN_SOURCES:.c=.obj32) $(WIN_SOURCES:.c=.obj64) + rm -f TestAgentd32.exe TestAgentd64.exe rm -f winetestbot.iso
Reducing the boot delay helps ensure there will be enough time for Windows to complete the reboot before the task times out, which may allow the TestBot to retrieve the report/logs/diagnostic information. Note that on 64-bit Windows this requires a 64-bit TestAgentd in order to be able to run bcdedit.exe. Also this only works on recent versions of Windows which is okay since a failure to change the boot delay will not prevent the tests from running.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- 64-bit Windows only has the 64-bit version of bcdedit.exe but it is not in the %PATH% of 32-bit processes. Worse, Windows' path rewriting prevents starting it even when specifying an absolute path... except if using the c:\Windows\SysNative hack. But in turn that does not work if there is no path rewriting such as on 32-bit Windows versions. --- testbot/bin/LibvirtTool.pl | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl index 00d1ce4f8e..ef662cdf19 100755 --- a/testbot/bin/LibvirtTool.pl +++ b/testbot/bin/LibvirtTool.pl @@ -651,6 +651,15 @@ sub CreateSnapshot($$$$) { FatalError("Could not reset the $VMKey Windows desktop background color\n"); } + + # Reduce the boot delay. The way to do this depends on the Windows + # version so this only works on recent ones :-( + my $PTA = GetPrivilegedTA($TA); + if (RunAndWait($PTA, ["bcdedit.exe", "/set", "{bootmgr}", "timeout", "1"])) + { + Error("Could not change the Windows boot delay on $VMKey\n"); + } + $Reboot = 1; }