All of lore.kernel.org
 help / color / mirror / Atom feed
* [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows
@ 2009-08-09 16:51 Michael Goldish
  2009-08-09 16:51 ` [KVM-AUTOTEST PATCH 1/7] KVM test: Simple remote shell server for use with Windows guests Michael Goldish
  2009-08-17 22:56 ` [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Lucas Meneghel Rodrigues
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm


This patch set adds the source code of rss.exe as well as a batch file that
prepares Windows guests for remote access (using rss.exe).
It adds 3 files under deps/ dir: rss.cpp, setuprss.bat and rss.reg.
The latter is required for Windows 2000 which seems to lack the reg command.

This set also adds steps files to setup rss.exe on all Windows guests.

It also contains a few small fixes which are somewhat unrelated but are needed
for the step files to function properly.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 1/7] KVM test: Simple remote shell server for use with Windows guests
  2009-08-09 16:51 [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Michael Goldish
@ 2009-08-09 16:51 ` Michael Goldish
  2009-08-09 16:51   ` [KVM-AUTOTEST PATCH 2/7] KVM test: Batch script that prepares a Windows guest for remote access Michael Goldish
  2009-08-17 22:56 ` [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Lucas Meneghel Rodrigues
  1 sibling, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

This server provides clients with an interactive cmd.exe shell.
It uses no encryption or authentication.

Usage: rss.exe [port]
The default port is 22.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/deps/rss.cpp |  467 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 467 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/deps/rss.cpp

diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
new file mode 100644
index 0000000..29e4957
--- /dev/null
+++ b/client/tests/kvm/deps/rss.cpp
@@ -0,0 +1,467 @@
+// Simple remote shell server
+// Author: Michael Goldish <mgoldish@redhat.com>
+// Much of the code here was adapted from Microsoft code samples.
+
+// Usage: rss.exe [port]
+// If no port is specified the default is 22.
+
+#define _WIN32_WINNT 0x0500
+
+#include <windows.h>
+#include <winsock2.h>
+#include <stdio.h>
+
+#pragma comment(lib, "ws2_32.lib")
+
+int port = 22;
+
+HWND hMainWindow = NULL;
+HWND hTextBox = NULL;
+
+struct client_info {
+    SOCKET socket;
+    sockaddr_in addr;
+    int pid;
+    HANDLE hJob;
+    HANDLE hChildOutputRead;
+    HANDLE hChildInputWrite;
+    HANDLE hThreadChildToSocket;
+};
+
+void ExitOnError(char *message, BOOL winsock = 0)
+{
+    LPVOID system_message;
+    char buffer[512];
+
+    int error_code;
+    if (winsock)
+        error_code = WSAGetLastError();
+    else
+        error_code = GetLastError();
+
+    WSACleanup();
+
+    FormatMessage(
+        FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
+        NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+        (LPTSTR)&system_message, 0, NULL);
+
+    sprintf(buffer,
+            "%s!\n"
+            "Error code = %d\n"
+            "Error message = %s",
+            message, error_code, (char *)system_message);
+
+    MessageBox(hMainWindow, buffer, "Error", MB_OK | MB_ICONERROR);
+
+    LocalFree(system_message);
+    ExitProcess(1);
+}
+
+void AppendMessage(char *message)
+{
+    int length = GetWindowTextLength(hTextBox);
+    SendMessage(hTextBox, EM_SETSEL, (WPARAM)length, (LPARAM)length);
+    SendMessage(hTextBox, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)message);
+}
+
+void FormatStringForPrinting(char *dst, char *src, int size)
+{
+    int j = 0;
+
+    for (int i = 0; i < size && src[i]; i++) {
+        if (src[i] == '\n') {
+            dst[j++] = '\\';
+            dst[j++] = 'n';
+        } else if (src[i] == '\r') {
+            dst[j++] = '\\';
+            dst[j++] = 'r';
+        } else if (src[i] == '\t') {
+            dst[j++] = '\\';
+            dst[j++] = 't';
+        } else if (src[i] == '\\') {
+            dst[j++] = '\\';
+            dst[j++] = '\\';
+        } else dst[j++] = src[i];
+    }
+    dst[j] = 0;
+}
+
+char* GetClientIPAddress(client_info *ci)
+{
+    char *address = inet_ntoa(ci->addr.sin_addr);
+    if (address)
+        return address;
+    else
+        return "unknown";
+}
+
+DWORD WINAPI ChildToSocket(LPVOID client_info_ptr)
+{
+    char buffer[1024], message[1024];
+    client_info ci;
+    DWORD bytes_read;
+    int bytes_sent;
+
+    memcpy(&ci, client_info_ptr, sizeof(ci));
+
+    while (1) {
+        // Read data from the child's STDOUT/STDERR pipes
+        if (!ReadFile(ci.hChildOutputRead,
+                      buffer, sizeof(buffer),
+                      &bytes_read, NULL) || !bytes_read) {
+            if (GetLastError() == ERROR_BROKEN_PIPE)
+                break; // Pipe done -- normal exit path
+            else
+                ExitOnError("ReadFile failed"); // Something bad happened
+        }
+        // Send data to the client
+        bytes_sent = send(ci.socket, buffer, bytes_read, 0);
+        /*
+        // Make sure all the data was sent
+        if (bytes_sent != bytes_read) {
+            sprintf(message,
+                    "ChildToSocket: bytes read (%d) != bytes sent (%d)",
+                    bytes_read, bytes_sent);
+            ExitOnError(message, 1);
+        }
+        */
+    }
+
+    AppendMessage("Child exited\r\n");
+    shutdown(ci.socket, SD_BOTH);
+
+    return 0;
+}
+
+DWORD WINAPI SocketToChild(LPVOID client_info_ptr)
+{
+    char buffer[256], formatted_buffer[768];
+    char message[1024], client_info_str[256];
+    client_info ci;
+    DWORD bytes_written;
+    int bytes_received;
+
+    memcpy(&ci, client_info_ptr, sizeof(ci));
+
+    sprintf(client_info_str, "address %s, port %d",
+            GetClientIPAddress(&ci), ci.addr.sin_port);
+
+    sprintf(message, "New client connected (%s)\r\n", client_info_str);
+    AppendMessage(message);
+
+    while (1) {
+        // Receive data from the socket
+        ZeroMemory(buffer, sizeof(buffer));
+        bytes_received = recv(ci.socket, buffer, sizeof(buffer), 0);
+        if (bytes_received <= 0)
+            break;
+        // Report the data received
+        FormatStringForPrinting(formatted_buffer, buffer, sizeof(buffer));
+        sprintf(message, "Client (%s) entered text: \"%s\"\r\n",
+                client_info_str, formatted_buffer);
+        AppendMessage(message);
+        // Write the data to the child's STDIN
+        WriteFile(ci.hChildInputWrite, buffer, bytes_received,
+                  &bytes_written, NULL);
+        // Make sure all the data was written
+        if (bytes_written != bytes_received) {
+            sprintf(message,
+                    "SocketToChild: bytes received (%d) != bytes written (%d)",
+                    bytes_received, bytes_written);
+            ExitOnError(message, 1);
+        }
+    }
+
+    sprintf(message, "Client disconnected (%s)\r\n", client_info_str);
+    AppendMessage(message);
+
+    // Attempt to terminate the child's process tree:
+    // Using taskkill (where available)
+    sprintf(buffer, "taskkill /PID %d /T /F", ci.pid);
+    system(buffer);
+    // .. and using TerminateJobObject()
+    TerminateJobObject(ci.hJob, 0);
+    // Wait for the ChildToSocket thread to terminate
+    WaitForSingleObject(ci.hThreadChildToSocket, 10000);
+    // In case the thread refuses to exit -- terminate it
+    TerminateThread(ci.hThreadChildToSocket, 0);
+    // Close the socket
+    shutdown(ci.socket, SD_BOTH);
+    closesocket(ci.socket);
+
+    // Close unnecessary handles
+    CloseHandle(ci.hJob);
+    CloseHandle(ci.hThreadChildToSocket);
+    CloseHandle(ci.hChildOutputRead);
+    CloseHandle(ci.hChildInputWrite);
+
+    AppendMessage("SocketToChild thread exited\r\n");
+
+    return 0;
+}
+
+void PrepAndLaunchRedirectedChild(client_info *ci,
+                                  HANDLE hChildStdOut,
+                                  HANDLE hChildStdIn,
+                                  HANDLE hChildStdErr)
+{
+    PROCESS_INFORMATION pi;
+    STARTUPINFO si;
+
+    // Set up the start up info struct.
+    ZeroMemory(&si, sizeof(STARTUPINFO));
+    si.cb = sizeof(STARTUPINFO);
+    si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+    si.hStdOutput = hChildStdOut;
+    si.hStdInput  = hChildStdIn;
+    si.hStdError  = hChildStdErr;
+    // Use this if you want to hide the child:
+    si.wShowWindow = SW_HIDE;
+    // Note that dwFlags must include STARTF_USESHOWWINDOW if you want to
+    // use the wShowWindow flags.
+
+    // Launch the process that you want to redirect.
+    if (!CreateProcess(NULL, "cmd.exe", NULL, NULL, TRUE,
+                       CREATE_NEW_CONSOLE, NULL, "C:\\", &si, &pi))
+        ExitOnError("CreateProcess failed");
+
+    // Close any unnecessary handles.
+    if (!CloseHandle(pi.hThread))
+        ExitOnError("CloseHandle failed");
+
+    // Keep the process ID
+    ci->pid = pi.dwProcessId;
+    // Assign the process to a newly created JobObject
+    ci->hJob = CreateJobObject(NULL, NULL);
+    AssignProcessToJobObject(ci->hJob, pi.hProcess);
+}
+
+void SpawnSession(client_info *ci)
+{
+    HANDLE hOutputReadTmp, hOutputRead, hOutputWrite;
+    HANDLE hInputWriteTmp, hInputRead, hInputWrite;
+    HANDLE hErrorWrite;
+    SECURITY_ATTRIBUTES sa;
+
+    // Set up the security attributes struct.
+    sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+    sa.lpSecurityDescriptor = NULL;
+    sa.bInheritHandle = TRUE;
+
+    // Create the child output pipe.
+    if (!CreatePipe(&hOutputReadTmp, &hOutputWrite, &sa, 0))
+        ExitOnError("CreatePipe failed");
+
+    // Create a duplicate of the output write handle for the std error
+    // write handle. This is necessary in case the child application
+    // closes one of its std output handles.
+    if (!DuplicateHandle(GetCurrentProcess(), hOutputWrite,
+                         GetCurrentProcess(), &hErrorWrite, 0,
+                         TRUE, DUPLICATE_SAME_ACCESS))
+        ExitOnError("DuplicateHandle failed");
+
+    // Create the child input pipe.
+    if (!CreatePipe(&hInputRead, &hInputWriteTmp, &sa, 0))
+        ExitOnError("CreatePipe failed");
+
+    // Create new output read handle and the input write handles. Set
+    // the Properties to FALSE. Otherwise, the child inherits the
+    // properties and, as a result, non-closeable handles to the pipes
+    // are created.
+    if (!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp,
+                         GetCurrentProcess(),
+                         &hOutputRead, // Address of new handle.
+                         0, FALSE, // Make it uninheritable.
+                         DUPLICATE_SAME_ACCESS))
+        ExitOnError("DuplicateHandle failed");
+
+    if (!DuplicateHandle(GetCurrentProcess(), hInputWriteTmp,
+                         GetCurrentProcess(),
+                         &hInputWrite, // Address of new handle.
+                         0, FALSE, // Make it uninheritable.
+                         DUPLICATE_SAME_ACCESS))
+        ExitOnError("DuplicateHandle failed");
+
+    // Close inheritable copies of the handles you do not want to be
+    // inherited.
+    if (!CloseHandle(hOutputReadTmp)) ExitOnError("CloseHandle failed");
+    if (!CloseHandle(hInputWriteTmp)) ExitOnError("CloseHandle failed");
+
+    PrepAndLaunchRedirectedChild(ci, hOutputWrite, hInputRead, hErrorWrite);
+
+    ci->hChildOutputRead = hOutputRead;
+    ci->hChildInputWrite = hInputWrite;
+
+    // Close pipe handles (do not continue to modify the parent).
+    // You need to make sure that no handles to the write end of the
+    // output pipe are maintained in this process or else the pipe will
+    // not close when the child process exits and the ReadFile will hang.
+    if (!CloseHandle(hOutputWrite)) ExitOnError("CloseHandle failed");
+    if (!CloseHandle(hInputRead )) ExitOnError("CloseHandle failed");
+    if (!CloseHandle(hErrorWrite)) ExitOnError("CloseHandle failed");
+}
+
+DWORD WINAPI ListenThread(LPVOID param)
+{
+    WSADATA wsaData;
+    SOCKET ListenSocket = INVALID_SOCKET;
+    sockaddr_in addr;
+    int result, addrlen;
+    client_info ci;
+    HANDLE hThread;
+
+    // Initialize Winsock
+    result = WSAStartup(MAKEWORD(2,2), &wsaData);
+    if (result)
+        ExitOnError("Winsock initialization failed");
+
+    // Create socket
+    ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (ListenSocket == INVALID_SOCKET)
+        ExitOnError("Socket creation failed", 1);
+
+    // Bind the socket
+    addr.sin_family = AF_INET;
+    addr.sin_addr.s_addr = htonl(INADDR_ANY);
+    addr.sin_port = htons(port);
+
+    result = bind(ListenSocket, (sockaddr *)&addr, sizeof(addr));
+    if (result == SOCKET_ERROR)
+        ExitOnError("bind failed", 1);
+
+    // Start listening for incoming connections
+    result = listen(ListenSocket, SOMAXCONN);
+    if (result == SOCKET_ERROR)
+        ExitOnError("listen failed", 1);
+
+    // Inform the user
+    AppendMessage("Waiting for clients to connect...\r\n");
+
+    while (1) {
+        addrlen = sizeof(ci.addr);
+        ci.socket = accept(ListenSocket, (sockaddr *)&ci.addr, &addrlen);
+        if (ci.socket == INVALID_SOCKET) {
+            if (WSAGetLastError() == WSAEINTR)
+                break;
+            else
+                ExitOnError("accept failed", 1);
+        }
+
+        // Under heavy load, spawning cmd.exe might take a while, so tell the
+        // client to be patient
+        char *message = "Please wait...\r\n";
+        send(ci.socket, message, strlen(message), 0);
+        // Spawn a new redirected cmd.exe process
+        SpawnSession(&ci);
+        // Start transferring data from the child process to the client
+        hThread = CreateThread(NULL, 0, ChildToSocket, (LPVOID)&ci, 0, NULL);
+        if (!hThread)
+            ExitOnError("Could not create ChildToSocket thread");
+        ci.hThreadChildToSocket = hThread;
+        // ... and from the client to the child process
+        hThread = CreateThread(NULL, 0, SocketToChild, (LPVOID)&ci, 0, NULL);
+        if (!hThread)
+            ExitOnError("Could not create SocketToChild thread");
+    }
+
+    return 0;
+}
+
+LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    RECT rect;
+    HANDLE hListenThread;
+
+    switch (msg) {
+        case WM_CREATE:
+            // Create text box
+            GetClientRect(hwnd, &rect);
+            hTextBox = CreateWindowEx(WS_EX_CLIENTEDGE,
+                                      "EDIT", "",
+                                      WS_CHILD|WS_VISIBLE|WS_VSCROLL|
+                                      ES_MULTILINE|ES_AUTOVSCROLL,
+                                      20, 20,
+                                      rect.right - 40,
+                                      rect.bottom - 40,
+                                      hwnd,
+                                      NULL,
+                                      GetModuleHandle(NULL),
+                                      NULL);
+            if (!hTextBox)
+                ExitOnError("Could not create text box");
+
+            // Set the font
+            SendMessage(hTextBox, WM_SETFONT,
+                        (WPARAM)GetStockObject(DEFAULT_GUI_FONT),
+                        MAKELPARAM(FALSE, 0));
+
+            // Start the listening thread
+            hListenThread =
+                CreateThread(NULL, 0, ListenThread, NULL, 0, NULL);
+            if (!hListenThread)
+                ExitOnError("Could not create server thread");
+            break;
+
+        case WM_DESTROY:
+            WSACleanup();
+            PostQuitMessage(0);
+            break;
+
+        default:
+            return DefWindowProc(hwnd, msg, wParam, lParam);
+    }
+
+    return 0;
+}
+
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+                   LPSTR lpCmdLine, int nShowCmd)
+{
+    WNDCLASSEX wc;
+    MSG msg;
+
+    if (strlen(lpCmdLine))
+        sscanf(lpCmdLine, "%d", &port);
+
+    // Make sure the firewall is disabled
+    system("netsh firewall set opmode disable");
+
+    // Create the window class
+    wc.cbSize        = sizeof(WNDCLASSEX);
+    wc.style         = CS_HREDRAW | CS_VREDRAW;
+    wc.lpfnWndProc   = WndProc;
+    wc.cbClsExtra    = 0;
+    wc.cbWndExtra    = 0;
+    wc.hInstance     = hInstance;
+    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
+    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);
+    wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
+    wc.lpszMenuName  = NULL;
+    wc.lpszClassName = "RemoteShellServerWindowClass";
+    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
+
+    if (!RegisterClassEx(&wc))
+        ExitOnError("Could not register window class");
+
+    // Create the main window
+    hMainWindow =
+        CreateWindow("RemoteShellServerWindowClass",
+                     "Remote Shell Server",
+                     WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX,
+                     20, 20, 500, 300,
+                     NULL, NULL, hInstance, NULL);
+    if (!hMainWindow)
+        ExitOnError("Could not create window");
+
+    ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
+    UpdateWindow(hMainWindow);
+
+    // Main message loop
+    while (GetMessage(&msg, NULL, 0, 0)) {
+        TranslateMessage(&msg);
+        DispatchMessage(&msg);
+    }
+
+    ExitProcess(0);
+}
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 2/7] KVM test: Batch script that prepares a Windows guest for remote access
  2009-08-09 16:51 ` [KVM-AUTOTEST PATCH 1/7] KVM test: Simple remote shell server for use with Windows guests Michael Goldish
@ 2009-08-09 16:51   ` Michael Goldish
  2009-08-09 16:51     ` [KVM-AUTOTEST PATCH 3/7] KVM test: Step files to setup the new remote shell server on Windows guests Michael Goldish
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

setuprss.bat copies rss.exe to C:\, makes it run at startup, disables the
firewall, sets a known password for the administrator account, makes it logon
automatically, and does some Vista/2008 specific things.

The script requires administrator privileges.

Usage: setuprss.bat [full path to executable]
e.g.: setuptrss.bat D:\rss.exe

If used without parameters, rss.exe will be copied from the directory in which
setuprss.bat resides.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/deps/rss.reg      |   15 +++++++++++++++
 client/tests/kvm/deps/setuprss.bat |   19 +++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/deps/rss.reg
 create mode 100644 client/tests/kvm/deps/setuprss.bat

diff --git a/client/tests/kvm/deps/rss.reg b/client/tests/kvm/deps/rss.reg
new file mode 100644
index 0000000..b285d40
--- /dev/null
+++ b/client/tests/kvm/deps/rss.reg
@@ -0,0 +1,15 @@
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
+"Remote Shell Server"="C:\\rss.exe 22"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\winlogon]
+"AutoAdminLogon"="1"
+"DefaultUserName"="Administrator"
+"DefaultPassword"="1q2w3eP"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]
+"EnableLUA"=dword:00000000
+
+[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Reliability]
+"ShutdownReasonOn"=dword:00000000
diff --git a/client/tests/kvm/deps/setuprss.bat b/client/tests/kvm/deps/setuprss.bat
new file mode 100644
index 0000000..1e4b5a7
--- /dev/null
+++ b/client/tests/kvm/deps/setuprss.bat
@@ -0,0 +1,19 @@
+set rsspath=%1
+if [%1]==[] set rsspath=%~dp0\rss.exe
+copy %rsspath% C:\rss.exe
+
+net user Administrator /active:yes
+net user Administrator 1q2w3eP
+netsh firewall set opmode disable
+
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe 22" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultUserName" /d "Administrator" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultPassword" /d "1q2w3eP" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /d "0" /t REG_DWORD /f
+reg add "HKLM\Software\Policies\Microsoft\Windows NT\Reliability" /v "ShutdownReasonOn" /d "0" /t REG_DWORD /f
+
+rem Just in case reg.exe is missing (e.g. Windows 2000):
+regedit /s %~dp0\rss.reg
+
+start /B C:\rss.exe
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 3/7] KVM test: Step files to setup the new remote shell server on Windows guests
  2009-08-09 16:51   ` [KVM-AUTOTEST PATCH 2/7] KVM test: Batch script that prepares a Windows guest for remote access Michael Goldish
@ 2009-08-09 16:51     ` Michael Goldish
  2009-08-09 16:51       ` [KVM-AUTOTEST PATCH 4/7] KVM test: step file tests: do not fail when receiving an invalid screendump Michael Goldish
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

This patch adds step files for Win2008.32, Win2008.64, WinVista.32,
WinVista.64, Win2003.32, Win2003.64, WinXP.32, WinXP.64 and Win2000.

I tried to make them as short as possible in order to minimize the chance of
failure.

This patch also adds the missing shutdown procedure to the end of the
Win2008.64 installation step file.

All files have been tested and seem to work properly, except Win2008.64, which
enters a reboot loop during installation (with several KVM versions).
This is not a step file problem, but the step file may contain errors because
it couldn't be properly tested.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/steps/Win2000-32-rss.steps  |   52 +++++++++++++++++++++++++
 client/tests/kvm/steps/Win2003-32-rss.steps  |   49 +++++++++++++++++++++++
 client/tests/kvm/steps/Win2003-64-rss.steps  |   47 ++++++++++++++++++++++
 client/tests/kvm/steps/Win2008-32-rss.steps  |   49 +++++++++++++++++++++++
 client/tests/kvm/steps/Win2008-64-rss.steps  |   52 +++++++++++++++++++++++++
 client/tests/kvm/steps/Win2008-64.steps      |   30 ++++++++++++++-
 client/tests/kvm/steps/WinVista-32-rss.steps |   54 ++++++++++++++++++++++++++
 client/tests/kvm/steps/WinVista-64-rss.steps |   54 ++++++++++++++++++++++++++
 client/tests/kvm/steps/WinXP-32-rss.steps    |   31 +++++++++++++++
 client/tests/kvm/steps/WinXP-64-rss.steps    |   34 ++++++++++++++++
 10 files changed, 451 insertions(+), 1 deletions(-)
 create mode 100644 client/tests/kvm/steps/Win2000-32-rss.steps
 create mode 100644 client/tests/kvm/steps/Win2003-32-rss.steps
 create mode 100644 client/tests/kvm/steps/Win2003-64-rss.steps
 create mode 100644 client/tests/kvm/steps/Win2008-32-rss.steps
 create mode 100644 client/tests/kvm/steps/Win2008-64-rss.steps
 create mode 100644 client/tests/kvm/steps/WinVista-32-rss.steps
 create mode 100644 client/tests/kvm/steps/WinVista-64-rss.steps
 create mode 100644 client/tests/kvm/steps/WinXP-32-rss.steps
 create mode 100644 client/tests/kvm/steps/WinXP-64-rss.steps

diff --git a/client/tests/kvm/steps/Win2000-32-rss.steps b/client/tests/kvm/steps/Win2000-32-rss.steps
new file mode 100644
index 0000000..34fa5f4
--- /dev/null
+++ b/client/tests/kvm/steps/Win2000-32-rss.steps
@@ -0,0 +1,52 @@
+# --------------------------------
+step 43.16
+screendump 20080101_000001_5b659c177604f5eefd34042a02463519.ppm
+# reached desktop; close "Getting Started" dialog
+barrier_2 86 12 120 58 deecf2363bbf8725264e9da8dd7a0c4e 216
+# Sending keys: alt-f4
+key alt-f4
+# --------------------------------
+step 45.98
+screendump 20080101_000002_e47965a8e2b13c234b2024caaf1cd8d2.ppm
+# open start menu
+barrier_2 83 62 283 219 34bb8f3f22754e871514abbc5a2d588a 14
+# Sending keys: ctrl-esc
+key ctrl-esc
+# --------------------------------
+step 47.91
+screendump 20080101_000003_b7fb19d51b89cb288639f2d528c6dd70.ppm
+# run...
+barrier_2 100 63 33 383 9f18731457b7d11c50ab92b81642c393 10
+# Sending keys: up up
+key up
+key up
+# --------------------------------
+step 49.98
+screendump 20080101_000004_e7a3f3fa3157129829c1526b0ad048e9.ppm
+barrier_2 43 19 63 389 32d9745c40deacbbed050934ecb22928 10
+# Sending keys: ret
+key ret
+# --------------------------------
+step 53.13
+screendump 20080101_000005_34cd11237ca61f9cf23dcacc4fd84826.ppm
+# run "d:\setuprss"
+barrier_2 53 75 254 306 9234a91426b8d28650cd6d2ddd60c0ff 16
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step unknown
+screendump 20080101_000014_e47965a8e2b13c234b2024caaf1cd8d2.ppm
+# make sure we're done
+sleep 20
+barrier_2 88 65 284 220 8ea5bd06fc592f91cdc322f4ed954469 120
diff --git a/client/tests/kvm/steps/Win2003-32-rss.steps b/client/tests/kvm/steps/Win2003-32-rss.steps
new file mode 100644
index 0000000..a194f6b
--- /dev/null
+++ b/client/tests/kvm/steps/Win2003-32-rss.steps
@@ -0,0 +1,49 @@
+# --------------------------------
+step 25.16
+screendump 20080101_000001_315f40a7863d9981afc999c525abd698.ppm
+barrier_2 48 13 425 231 4da32ca10d3191bc95eba6552c1e3d4d 180
+# Sending keys: ctrl-alt-delete
+key ctrl-alt-delete
+# --------------------------------
+step 27.98
+screendump 20080101_000002_9c888fc55dbcff4c54b2c8ca9abea561.ppm
+# login
+barrier_2 32 11 469 230 3b7b1974fe99ef2ceee9d49e2885253f 30
+# Sending keys: ret
+key ret
+# --------------------------------
+step 40.75
+screendump 20080101_000003_b29321f21ff99f7570213c9e53b2806a.ppm
+barrier_2 66 45 209 233 f8e61ca0d97b8af750fe7c3451401498 90
+# Sending keys: alt-f4
+key alt-f4
+# --------------------------------
+step 43.99
+screendump 20080101_000004_4e23508d4bf604e5939c9a715bde4e33.ppm
+# run command
+barrier_2 63 41 213 229 61e4e55ac2f0bc30a92d141363c1895a 16
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 49.52
+screendump 20080101_000006_f959391507e8a2eb9af10a802db56d7e.ppm
+# run "d:\setuprss"
+barrier_2 261 34 57 307 62d58248f633ce21c7330ab430e087eb 14
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 88.35
+screendump 20080101_000015_dc5545b4db2a21f13918af699a9e1ffb.ppm
+# done
+barrier_2 62 41 208 229 0da402920a310728fb3cd78e4cbfc13a 90
diff --git a/client/tests/kvm/steps/Win2003-64-rss.steps b/client/tests/kvm/steps/Win2003-64-rss.steps
new file mode 100644
index 0000000..ad9247c
--- /dev/null
+++ b/client/tests/kvm/steps/Win2003-64-rss.steps
@@ -0,0 +1,47 @@
+# Generated by Step Maker
+# Generated on Sat Aug  8 22:59:51 2009
+# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
+# --------------------------------
+step 25.16
+screendump 20080101_000001_315f40a7863d9981afc999c525abd698.ppm
+barrier_2 48 13 425 231 4da32ca10d3191bc95eba6552c1e3d4d 180
+# Sending keys: ctrl-alt-delete
+key ctrl-alt-delete
+# --------------------------------
+step 27.98
+screendump 20080101_000002_9c888fc55dbcff4c54b2c8ca9abea561.ppm
+# login
+barrier_2 32 11 469 230 3b7b1974fe99ef2ceee9d49e2885253f 30
+# Sending keys: ret
+key ret
+# --------------------------------
+step 3.89
+screendump 20090808_225955_b71e538f693e411895d125b28764dbe3.ppm
+# reached desktop
+barrier_2 80 56 285 226 33ef5647b80b4cb24ea68221121a6cdb 180
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 15.63
+screendump 20090808_230251_bb4e1f7922b0f4c7dd1ba08633fd2740.ppm
+# run "d:\setuprss"
+barrier_2 263 34 56 306 cd45be08381106e04309bd65f2538571 25
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 3.89
+screendump 20090808_225955_b71e538f693e411895d125b28764dbe3.ppm
+# make sure we're done
+sleep 20
+barrier_2 80 56 285 226 33ef5647b80b4cb24ea68221121a6cdb 90
diff --git a/client/tests/kvm/steps/Win2008-32-rss.steps b/client/tests/kvm/steps/Win2008-32-rss.steps
new file mode 100644
index 0000000..0194dad
--- /dev/null
+++ b/client/tests/kvm/steps/Win2008-32-rss.steps
@@ -0,0 +1,49 @@
+# --------------------------------
+step 40.51
+screendump 20080101_000001_7a0db57f6d01f839e830c034906e18ba.ppm
+barrier_2 470 64 167 217 6315f1c924edab4bff73403959131051 203
+# Sending keys: ctrl-alt-delete
+key ctrl-alt-delete
+# --------------------------------
+step 44.89
+screendump 20080101_000002_b48665cc639417d1c0534b06eff5afdb.ppm
+barrier_2 50 16 296 393 cebca0ab4704c6f674987b582e400c5f 22
+# Sending keys: 1 q 2 w 3 e shift-p ret
+key 1
+key q
+key 2
+key w
+key 3
+key e
+key shift-p
+key ret
+# --------------------------------
+step unknown
+screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
+barrier_2 46 45 375 290 b31d69288fc8d8b7661cfe5d5c93c117 292
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 132.34
+screendump 20080101_000010_fbb85586d6ae0a031d6eea173e3fd940.ppm
+# run "d:\setuprss"
+barrier_2 35 60 268 387 ba4f5d1fd4282cac4f6bb93b8adb2911 12
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 175.40
+screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
+# all done!
+sleep 20
+barrier_2 53 48 369 289 17a327dc76e1e0b26a69350bbe31f2d6 90
diff --git a/client/tests/kvm/steps/Win2008-64-rss.steps b/client/tests/kvm/steps/Win2008-64-rss.steps
new file mode 100644
index 0000000..0a72885
--- /dev/null
+++ b/client/tests/kvm/steps/Win2008-64-rss.steps
@@ -0,0 +1,52 @@
+# --------------------------------
+step 40.51
+screendump 20080101_000001_7a0db57f6d01f839e830c034906e18ba.ppm
+# (screendump taken from Win2008.32)
+barrier_2 61 56 379 287 40a28652310261533c6018439c58fb15 203
+# Sending keys: ctrl-alt-delete
+key ctrl-alt-delete
+# --------------------------------
+step 44.89
+screendump 20080101_000002_b48665cc639417d1c0534b06eff5afdb.ppm
+# (screendump taken from Win2008.32)
+barrier_2 44 33 418 385 c68f71048c2fc84e82ed7fa84abe62a3 22
+# Sending keys: 1 q 2 w 3 e shift-p ret
+key 1
+key q
+key 2
+key w
+key 3
+key e
+key shift-p
+key ret
+# --------------------------------
+step unknown
+screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
+# (screendump taken from Win2008.32)
+barrier_2 46 45 375 290 b31d69288fc8d8b7661cfe5d5c93c117 292
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 132.34
+screendump 20080101_000010_fbb85586d6ae0a031d6eea173e3fd940.ppm
+# run "d:\setuprss" (screendump taken from Win2008.32)
+barrier_2 37 34 313 431 1a110a076ce7a418294c007fa9070eee 12
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 175.40
+screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
+# all done! (screendump taken from Win2008.32)
+sleep 20
+barrier_2 53 48 369 289 17a327dc76e1e0b26a69350bbe31f2d6 90
diff --git a/client/tests/kvm/steps/Win2008-64.steps b/client/tests/kvm/steps/Win2008-64.steps
index 932b873..e9e23be 100644
--- a/client/tests/kvm/steps/Win2008-64.steps
+++ b/client/tests/kvm/steps/Win2008-64.steps
@@ -73,5 +73,33 @@ key ret
 # --------------------------------
 step 1732.47
 screendump 20080101_000011_b8ee0f8e288f7dd443605e0cf5d91c61.ppm
-# Win2008 Finish
+# Desktop reached
 barrier_2 49 16 2 579 5bfe5b0a9fa7648373e9ad84d3119a5d 232
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 1732.47
+screendump 20090809_051015_fbb85586d6ae0a031d6eea173e3fd940.ppm
+# Shutdown (screendump taken from Win2008.32)
+barrier_2 38 35 312 430 684748292c757ae5eb7bf4299df70171 10
+# Sending keys: s h u t d o w n spc slash s spc slash f spc slash t spc 0 ret
+key s
+key h
+key u
+key t
+key d
+key o
+key w
+key n
+key spc
+key slash
+key s
+key spc
+key slash
+key f
+key spc
+key slash
+key t
+key spc
+key 0
+key ret
diff --git a/client/tests/kvm/steps/WinVista-32-rss.steps b/client/tests/kvm/steps/WinVista-32-rss.steps
new file mode 100644
index 0000000..643f52e
--- /dev/null
+++ b/client/tests/kvm/steps/WinVista-32-rss.steps
@@ -0,0 +1,54 @@
+# Generated by Step Maker
+# Generated on Sun Aug  9 04:19:57 2009
+# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
+# --------------------------------
+step 71.65
+screendump 20090809_042109_8c9fa395fde6d45736fe5e78ebad061e.ppm
+# reached desktop; open start menu
+barrier_2 78 30 358 234 d864236c59edceb198409f034b61aa0e 358
+# Sending keys: ctrl-esc
+key ctrl-esc
+# --------------------------------
+step 76.05
+screendump 20090809_042139_c3155a2c89fcd79dc61478af560ed357.ppm
+# run "d:\setuprss"
+barrier_2 50 13 28 545 42dcbd7b221f12845583f08fb6dbbc66 21
+# Sending keys: d shift-0x27 0x2b s e t u p r s s
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+# --------------------------------
+step 83.19
+screendump 20090809_042249_46f97eb05a2aabfc918fed642038c03a.ppm
+barrier_2 18 25 14 12 0f48ac3d9a2c1d88d0519721129ce8bf 23
+# Sending keys: down menu
+key down
+key menu
+# --------------------------------
+step 88.52
+screendump 20090809_042324_0eac577fff261097eb35e8a3e41b11ba.ppm
+# run as administrator
+barrier_2 21 58 128 138 9d6d14c39767166f2dd54b644b4430a3 24
+# Sending keys: a
+key a
+# --------------------------------
+step 93.15
+screendump 20090809_042342_0abaf4bb1d04389c5b4548dc031989ca.ppm
+# continue
+barrier_2 20 44 248 239 522013a7f99ea1a1dfbb4a4d5c61dd2a 90
+# Sending keys: alt-c
+key alt-c
+# --------------------------------
+step 102.84
+screendump 20090809_042403_e287c85ba9d66dd09412917bfc1fecb5.ppm
+# make sure we're done
+sleep 20
+barrier_2 87 25 353 387 4335934bbb63865c37aa2aa6c2376440 90
diff --git a/client/tests/kvm/steps/WinVista-64-rss.steps b/client/tests/kvm/steps/WinVista-64-rss.steps
new file mode 100644
index 0000000..611a420
--- /dev/null
+++ b/client/tests/kvm/steps/WinVista-64-rss.steps
@@ -0,0 +1,54 @@
+# Generated by Step Maker
+# Generated on Sun Aug  9 03:27:16 2009
+# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
+# --------------------------------
+step 78.22
+screendump 20090809_032834_6adc21f17f854751b7c5ef6814afe4be.ppm
+# reached desktop; open start menu
+barrier_2 109 32 319 245 e40688e5ea8acae0068bf32ae0882d66 391
+# Sending keys: ctrl-esc
+key ctrl-esc
+# --------------------------------
+step 83.61
+screendump 20090809_033130_129378458c3edb1ef199ba8dbb6450fa.ppm
+# run "d:\setuprss"
+barrier_2 56 16 26 543 92e2726e7aa3de5bda7cb0448729e569 26
+# Sending keys: d shift-0x27 0x2b s e t u p r s s
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+# --------------------------------
+step 90.03
+screendump 20090809_033308_427a6436d2d53bc48a550d6e9d51ea30.ppm
+barrier_2 17 23 14 12 1ee0bb3e04af4ae9cad6ea4d7e60ee0c 20
+# Sending keys: down menu
+key down
+key menu
+# --------------------------------
+step 93.51
+screendump 20090809_033402_35adbe6265a33ea3e710bc6c345ddeb4.ppm
+# run as administrator
+barrier_2 24 63 128 138 f1048184cda8600c51d6b4c8c272d60f 15
+# Sending keys: a
+key a
+# --------------------------------
+step 99.21
+screendump 20090809_033431_30cfd66164171798c723f1ebd9d2dd63.ppm
+# continue
+barrier_2 30 45 240 239 a99732ded3422fa552a5eebd19104bf1 90
+# Sending keys: alt-c
+key alt-c
+# --------------------------------
+step 110.47
+screendump 20090809_033505_56d081cf5ec82e94c86341cfe782f982.ppm
+# done
+sleep 20
+barrier_2 102 30 328 387 989a51cb302891c8a0a1ff5cc9a528be 90
diff --git a/client/tests/kvm/steps/WinXP-32-rss.steps b/client/tests/kvm/steps/WinXP-32-rss.steps
new file mode 100644
index 0000000..8adc8f5
--- /dev/null
+++ b/client/tests/kvm/steps/WinXP-32-rss.steps
@@ -0,0 +1,31 @@
+# --------------------------------
+step 24.72
+screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
+# desktop reached -- run command
+barrier_2 47 49 392 292 09453beafc5f60b6dcb9af1b27339ca1 124
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 29.87
+screendump 20080101_000003_3978b6f6e3cd2d7c4c4caaf6e1e35330.ppm
+# run "d:\setuprss"
+barrier_2 43 103 266 426 c5dc4e4ac4c50a90f35399cc126232ed 30
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 64.82
+screendump 20080101_000012_eccf0a634b6fc479327cf9cc165da7ae.ppm
+# done
+sleep 20
+barrier_2 92 133 395 244 ccda184de1b1d68eb091e2950792cb2f 90
diff --git a/client/tests/kvm/steps/WinXP-64-rss.steps b/client/tests/kvm/steps/WinXP-64-rss.steps
new file mode 100644
index 0000000..a47c19c
--- /dev/null
+++ b/client/tests/kvm/steps/WinXP-64-rss.steps
@@ -0,0 +1,34 @@
+# Generated by Step Maker
+# Generated on Sat Aug  8 22:08:14 2009
+# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
+# --------------------------------
+step 45.95
+screendump 20090808_220900_04a6bdc48c7e7b21c40da156b3c5e39a.ppm
+# desktop reached
+barrier_2 68 20 10 455 84c2097166d61662c0da0f522ba6a860 230
+# Sending keys: 0xdc-r
+key 0xdc-r
+# --------------------------------
+step 53.61
+screendump 20090808_221018_06c2ba8c6966a365906b77617c83d476.ppm
+# run "d:\setuprss"
+barrier_2 16 93 212 323 64761f230c3f6e00edb6b063aed94a4d 37
+# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
+key d
+key shift-0x27
+key 0x2b
+key s
+key e
+key t
+key u
+key p
+key r
+key s
+key s
+key ret
+# --------------------------------
+step 69.47
+screendump 20090808_221132_2cd6b5b84c57818069a39edcd6598670.ppm
+# done
+sleep 20
+barrier_2 60 48 298 227 a69789a0554529572d8b721dc0a6bf9a 69
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 4/7] KVM test: step file tests: do not fail when receiving an invalid screendump
  2009-08-09 16:51     ` [KVM-AUTOTEST PATCH 3/7] KVM test: Step files to setup the new remote shell server on Windows guests Michael Goldish
@ 2009-08-09 16:51       ` Michael Goldish
  2009-08-09 16:51         ` [KVM-AUTOTEST PATCH 5/7] KVM test: stepmaker.py: Do not attempt to use undefined variable 'version' Michael Goldish
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Warn, instead of failing, when receiving an invalid PPM screendump.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_guest_wizard.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/client/tests/kvm/kvm_guest_wizard.py b/client/tests/kvm/kvm_guest_wizard.py
index 732e427..4efb0e9 100644
--- a/client/tests/kvm/kvm_guest_wizard.py
+++ b/client/tests/kvm/kvm_guest_wizard.py
@@ -88,14 +88,15 @@ def barrier_2(vm, words, params, debug_dir, data_scrdump_filename,
             logging.error("Could not fetch screendump")
             continue
 
-        # Make sure image is valid
-        if not ppm_utils.image_verify_ppm_file(scrdump_filename):
-            failure_message = "got invalid screendump"
-            break
-
         # Read image file
         (w, h, data) = ppm_utils.image_read_from_ppm_file(scrdump_filename)
 
+        # Make sure image is valid
+        if not ppm_utils.image_verify_ppm_file(scrdump_filename):
+            logging.warn("Got invalid screendump: dimensions: %dx%d, "
+                         "data size: %d" % (w, h, len(data)))
+            continue
+
         # Compute md5sum of whole image
         whole_image_md5sum = ppm_utils.image_md5sum(w, h, data)
 
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 5/7] KVM test: stepmaker.py: Do not attempt to use undefined variable 'version'
  2009-08-09 16:51       ` [KVM-AUTOTEST PATCH 4/7] KVM test: step file tests: do not fail when receiving an invalid screendump Michael Goldish
@ 2009-08-09 16:51         ` Michael Goldish
  2009-08-09 16:51           ` [KVM-AUTOTEST PATCH 6/7] KVM test: shutdown test: do not close session immediately after shutdown command Michael Goldish
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

The version variable is used even though it is no longer defined.  This patch
fixes this.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/stepmaker.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/stepmaker.py b/client/tests/kvm/stepmaker.py
index 6f1e6a1..e478350 100644
--- a/client/tests/kvm/stepmaker.py
+++ b/client/tests/kvm/stepmaker.py
@@ -47,8 +47,7 @@ class StepMaker(stepeditor.StepMakerWindow):
         self.time_when_done_clicked = time.time()
         self.time_when_actions_completed = time.time()
 
-        self.steps_file.write("# Generated by Step Maker version %s\n" %
-                              version)
+        self.steps_file.write("# Generated by Step Maker\n")
         self.steps_file.write("# Generated on %s\n" % time.asctime())
         self.steps_file.write("# uname -a: %s\n" %
                               commands.getoutput("uname -a"))
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 6/7] KVM test: shutdown test: do not close session immediately after shutdown command
  2009-08-09 16:51         ` [KVM-AUTOTEST PATCH 5/7] KVM test: stepmaker.py: Do not attempt to use undefined variable 'version' Michael Goldish
@ 2009-08-09 16:51           ` Michael Goldish
  2009-08-09 16:51             ` [KVM-AUTOTEST PATCH 7/7] KVM test: use homemade remote shell server (rss.exe) for all Windows guests Michael Goldish
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

If the session is closed immediately after a command is sent, the command may
not be executed.
To overcome this, first wait for the guest to shut down, and then close
the session.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_tests.py |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
index d98dbae..9cd01e2 100644
--- a/client/tests/kvm/kvm_tests.py
+++ b/client/tests/kvm/kvm_tests.py
@@ -80,18 +80,20 @@ def run_shutdown(test, params, env):
     if not session:
         raise error.TestFail("Could not log into guest")
 
-    logging.info("Logged in")
+    try:
+        logging.info("Logged in")
 
-    # Send the VM's shutdown command
-    session.sendline(vm.get_params().get("shutdown_command"))
-    session.close()
+        # Send the VM's shutdown command
+        session.sendline(vm.get_params().get("shutdown_command"))
+        logging.info("Shutdown command sent; waiting for guest to go down...")
 
-    logging.info("Shutdown command sent; waiting for guest to go down...")
+        if not kvm_utils.wait_for(vm.is_dead, 240, 0, 1):
+            raise error.TestFail("Guest refuses to go down")
 
-    if not kvm_utils.wait_for(vm.is_dead, 240, 0, 1):
-        raise error.TestFail("Guest refuses to go down")
+        logging.info("Guest is down")
 
-    logging.info("Guest is down")
+    finally:
+        session.close()
 
 
 def run_migration(test, params, env):
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [KVM-AUTOTEST PATCH 7/7] KVM test: use homemade remote shell server (rss.exe) for all Windows guests
  2009-08-09 16:51           ` [KVM-AUTOTEST PATCH 6/7] KVM test: shutdown test: do not close session immediately after shutdown command Michael Goldish
@ 2009-08-09 16:51             ` Michael Goldish
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Goldish @ 2009-08-09 16:51 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

This patch modifies kvm_tests.cfg.sample.

1. It makes all Windows guests use rss.exe, using the new step files and
   an ISO file named rss.iso, which should be created by the user.  rss.iso
   should contain rss.exe, setuprss.bat and rss.reg.  These files are all
   assumed to be in D:\.

2. Currently WinVista.32, WinVista.64, Win2008.64, Win2003.64 and WinXP.64 can
   run only the install test.  This patch makes them run all available tests,
   like the other Windows guests.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_tests.cfg.sample |   70 ++++++++++++++++++---------------
 1 files changed, 38 insertions(+), 32 deletions(-)

diff --git a/client/tests/kvm/kvm_tests.cfg.sample b/client/tests/kvm/kvm_tests.cfg.sample
index 74901a6..12e907b 100644
--- a/client/tests/kvm/kvm_tests.cfg.sample
+++ b/client/tests/kvm/kvm_tests.cfg.sample
@@ -334,17 +334,16 @@ variants:
 
     # Windows section
     - @Windows:
-        no autotest
+        no autotest linux_s3
         shutdown_command = shutdown /s /t 0
         reboot_command = shutdown /r /t 0
         status_test_command = echo %errorlevel%
         shell_prompt = "C:\\.{0,50}>"
-        username = Administrator
-        password = 123456
-        shell_client = ssh
+        shell_client = nc
         shell_port = 22
-        file_transfer_client = scp
-        file_transfer_port = 22
+        # File transfers are currently unsupported
+        #file_transfer_client = scp
+        #file_transfer_port = 22
 
         migrate:
             migration_test_command = ver && vol
@@ -378,8 +377,8 @@ variants:
                     md5sum_1m = dd28fba196d366d56fe774bd93df5527
                     user = user
                 setup:
-                    steps = Win2000-32-setupssh.steps
-                    cdrom = windows/setupssh.iso
+                    steps = Win2000-32-rss.steps
+                    cdrom = windows/rss.iso
 
             - WinXP.32:
                 image_name = winXP-32
@@ -390,11 +389,11 @@ variants:
                     md5sum_1m = b473bf75af2d1269fec8958cf0202bfd
                     user = user
                 setup:
-                    steps = WinXP-32-setupssh.steps
-                    cdrom = windows/setupssh.iso
+                    steps = WinXP-32-rss.steps
+                    cdrom = windows/rss.iso
 
             - WinXP.64:
-                only install
+                no reboot
                 image_name = winXP-64
                 install:
                     steps = WinXP-64.steps
@@ -402,6 +401,9 @@ variants:
                     md5sum = 8d3f007ec9c2060cec8a50ee7d7dc512
                     md5sum_1m = e812363ff427effc512b7801ee70e513
                     user = user
+                setup:
+                    steps = WinXP-64-rss.steps
+                    cdrom = windows/rss.iso
 
             - Win2003:
                 image_size = 20G
@@ -418,11 +420,10 @@ variants:
                             md5sum_1m = 37c2fdec15ac4ec16aa10fdfdb338aa3
                             user = user
                         setup:
-                            steps = Win2003-32-setupssh.steps
-                            cdrom = windows/setupssh.iso
+                            steps = Win2003-32-rss.steps
+                            cdrom = windows/rss.iso
 
                     - 64:
-                        only install
                         image_name = win2003-64
                         install:
                             steps = Win2003-64.steps
@@ -430,37 +431,42 @@ variants:
                             md5sum = 5703f87c9fd77d28c05ffadd3354dbbd
                             md5sum_1m = 439393c384116aa09e08a0ad047dcea8
                             user = user
+                        setup:
+                            steps = Win2003-64-rss.steps
+                            cdrom = windows/rss.iso
 
             - WinVista:
-                only install
                 image_name = winvista
                 image_size = 20G
 
                 variants:
                     - 32:
                         image_name += -32
-                        steps = Win-Vista-32.steps
-                        cdrom = windows/WindowsVista-32.iso
-                        md5sum = 1008f323d5170c8e614e52ccb85c0491
-                        md5sum_1m = c724e9695da483bc0fd59e426eaefc72
+                        install:
+                            steps = Win-Vista-32.steps
+                            cdrom = windows/WindowsVista-32.iso
+                            md5sum = 1008f323d5170c8e614e52ccb85c0491
+                            md5sum_1m = c724e9695da483bc0fd59e426eaefc72
+                        setup:
+                            steps = WinVista-32-rss.steps
+                            cdrom = windows/rss.iso
 
                     - 64:
                         image_name += -64
-                        steps = Win-Vista-64.steps
-                        cdrom = windows/WindowsVista-64.iso
-                        md5sum = 11e2010d857fffc47813295e6be6d58d
-                        md5sum_1m = 0947bcd5390546139e25f25217d6f165
+                        install:
+                            steps = Win-Vista-64.steps
+                            cdrom = windows/WindowsVista-64.iso
+                            md5sum = 11e2010d857fffc47813295e6be6d58d
+                            md5sum_1m = 0947bcd5390546139e25f25217d6f165
+                        setup:
+                            steps = WinVista-64-rss.steps
+                            cdrom = windows/rss.iso
 
             - Win2008:
                 image_name = win2008
                 image_size = 20G
                 shutdown_command = shutdown /s /f /t 0
                 reboot_command = shutdown /r /f /t 0
-                shell_port = 23
-                guest_port_remote_shell = 23
-                use_telnet = yes
-                username = Administrator
-                password = 1q2w3eP
 
                 variants:
                     - 32:
@@ -473,8 +479,8 @@ variants:
                             md5sum=0bfca49f0164de0a8eba236ced47007d
                             md5sum_1m=07d7f5006393f74dc76e6e2e943e2440
                         setup:
-                            steps = Win2008-32-setuptelnet.steps
-                            cdrom = windows/setuptelnet.iso
+                            steps = Win2008-32-rss.steps
+                            cdrom = windows/rss.iso
 
                     - 64:
                         image_name += -64
@@ -487,8 +493,8 @@ variants:
                             md5sum_1m=efdcc11d485a1ef9afa739cb8e0ca766
                             passwd = 1q2w3eP
                         setup:
-                            steps = Win2008-32-setuptelnet.steps
-                            cdrom = windows/setuptelnet.iso
+                            steps = Win2008-64-rss.steps
+                            cdrom = windows/rss.iso
 
     # Unix/BSD section
     - @Unix:
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows
  2009-08-09 16:51 [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Michael Goldish
  2009-08-09 16:51 ` [KVM-AUTOTEST PATCH 1/7] KVM test: Simple remote shell server for use with Windows guests Michael Goldish
@ 2009-08-17 22:56 ` Lucas Meneghel Rodrigues
  2009-08-18 10:15   ` Michael Goldish
  1 sibling, 1 reply; 15+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-08-17 22:56 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm

Ok, very good, similarly to the previous patchset, I rebased one of
the patches and applied the set, I am making tests with an rss binary
generated by the cross compiler.

I am testing with Winxp 32 bit, so far so good and rss.exe works as
expected. I guess I will test more with other hosts, but I am not too
far from applying this patchset as well.

Will keep you posted!

On Sun, Aug 9, 2009 at 1:51 PM, Michael Goldish<mgoldish@redhat.com> wrote:
>
> This patch set adds the source code of rss.exe as well as a batch file that
> prepares Windows guests for remote access (using rss.exe).
> It adds 3 files under deps/ dir: rss.cpp, setuprss.bat and rss.reg.
> The latter is required for Windows 2000 which seems to lack the reg command.
>
> This set also adds steps files to setup rss.exe on all Windows guests.
>
> It also contains a few small fixes which are somewhat unrelated but are needed
> for the step files to function properly.
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas Meneghel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new  remote shell server for Windows
  2009-08-17 22:56 ` [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Lucas Meneghel Rodrigues
@ 2009-08-18 10:15   ` Michael Goldish
  2009-08-18 13:20     ` Lucas Meneghel Rodrigues
  2009-08-18 15:36     ` Lucas Meneghel Rodrigues
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Goldish @ 2009-08-18 10:15 UTC (permalink / raw)
  To: Lucas Meneghel Rodrigues; +Cc: autotest, kvm


----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:

> Ok, very good, similarly to the previous patchset, I rebased one of
> the patches and applied the set, I am making tests with an rss binary
> generated by the cross compiler.
> 
> I am testing with Winxp 32 bit, so far so good and rss.exe works as
> expected. I guess I will test more with other hosts, but I am not too
> far from applying this patchset as well.
> 
> Will keep you posted!

Note that this patchset should also allow you to install rss.exe
automatically using step files, so I hope that in your tests you're not
installing it manually.  I'm not expecting you to test everything (it
takes quite a while), but if you're testing anyway, better let the step
files do some work too.

(I know we'll start using unattended installation scripts soon but it
doesn't hurt to have functional step files too.)

Also note that using a certain qemu/KVM version I couldn't get Vista to
work with user mode.  This isn't an rss.exe problem.  In TAP mode it
works just fine.

In any case, thanks for reviewing and testing the patchsets.

I'll try to write a proper review of the core dump capture feature and
the unattended installations as soon as I can.

Thanks,
Michael

> On Sun, Aug 9, 2009 at 1:51 PM, Michael Goldish<mgoldish@redhat.com>
> wrote:
> >
> > This patch set adds the source code of rss.exe as well as a batch
> file that
> > prepares Windows guests for remote access (using rss.exe).
> > It adds 3 files under deps/ dir: rss.cpp, setuprss.bat and rss.reg.
> > The latter is required for Windows 2000 which seems to lack the reg
> command.
> >
> > This set also adds steps files to setup rss.exe on all Windows
> guests.
> >
> > It also contains a few small fixes which are somewhat unrelated but
> are needed
> > for the step files to function properly.
> > _______________________________________________
> > Autotest mailing list
> > Autotest@test.kernel.org
> > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
> >
> 
> 
> 
> -- 
> Lucas Meneghel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows
  2009-08-18 10:15   ` Michael Goldish
@ 2009-08-18 13:20     ` Lucas Meneghel Rodrigues
  2009-08-18 15:36     ` Lucas Meneghel Rodrigues
  1 sibling, 0 replies; 15+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-08-18 13:20 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm

On Tue, Aug 18, 2009 at 7:15 AM, Michael Goldish<mgoldish@redhat.com> wrote:
>
> ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
>
>> Ok, very good, similarly to the previous patchset, I rebased one of
>> the patches and applied the set, I am making tests with an rss binary
>> generated by the cross compiler.
>>
>> I am testing with Winxp 32 bit, so far so good and rss.exe works as
>> expected. I guess I will test more with other hosts, but I am not too
>> far from applying this patchset as well.
>>
>> Will keep you posted!
>
> Note that this patchset should also allow you to install rss.exe
> automatically using step files, so I hope that in your tests you're not
> installing it manually.  I'm not expecting you to test everything (it
> takes quite a while), but if you're testing anyway, better let the step
> files do some work too.

Absolutely, the setup is being done on the step file stage.

I have tested the 2003 and 2008 family (so 2003 and xp, 2008 and
vista), and they are all looking good. On win2000 I let the tests run,
but something is failing during the setup test. Need to check what
exactly is failing.

> (I know we'll start using unattended installation scripts soon but it
> doesn't hurt to have functional step files too.)

Absolutely, I also think it's good to have good and well maintained step files.

> Also note that using a certain qemu/KVM version I couldn't get Vista to
> work with user mode.  This isn't an rss.exe problem.  In TAP mode it
> works just fine.
>
> In any case, thanks for reviewing and testing the patchsets.
>
> I'll try to write a proper review of the core dump capture feature and
> the unattended installations as soon as I can.

Thanks!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows
  2009-08-18 10:15   ` Michael Goldish
  2009-08-18 13:20     ` Lucas Meneghel Rodrigues
@ 2009-08-18 15:36     ` Lucas Meneghel Rodrigues
  2009-08-18 22:30       ` Michael Goldish
  1 sibling, 1 reply; 15+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-08-18 15:36 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm, sudhir kumar

On Tue, Aug 18, 2009 at 7:15 AM, Michael Goldish<mgoldish@redhat.com> wrote:
>
> ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
>
>> Ok, very good, similarly to the previous patchset, I rebased one of
>> the patches and applied the set, I am making tests with an rss binary
>> generated by the cross compiler.
>>
>> I am testing with Winxp 32 bit, so far so good and rss.exe works as
>> expected. I guess I will test more with other hosts, but I am not too
>> far from applying this patchset as well.
>>
>> Will keep you posted!
>
> Note that this patchset should also allow you to install rss.exe
> automatically using step files, so I hope that in your tests you're not
> installing it manually.  I'm not expecting you to test everything (it
> takes quite a while), but if you're testing anyway, better let the step
> files do some work too.
>
> (I know we'll start using unattended installation scripts soon but it
> doesn't hurt to have functional step files too.)
>
> Also note that using a certain qemu/KVM version I couldn't get Vista to
> work with user mode.  This isn't an rss.exe problem.  In TAP mode it
> works just fine.
>
> In any case, thanks for reviewing and testing the patchsets.

Ok Michael, turns out the win2000 failure was a silly mistake. So,
after checking the code and going trough light testing, I applied this
patchset

http://autotest.kernel.org/changeset/3553
http://autotest.kernel.org/changeset/3554
http://autotest.kernel.org/changeset/3555
http://autotest.kernel.org/changeset/3556

Sudhir, perhaps you can try the upstream tree starting with r3556. It
has all the changes you have asked for earlier (rss and stuff).

In order to get things all set, I suggest:

1) Create a directory with the following contents:

[lmr@freedom rss]$ ls -l
total 52
-rwxrwxr-x. 1 lmr lmr 42038 2009-08-17 18:55 rss.exe
-rw-rw-r--. 1 lmr lmr   517 2009-08-17 18:57 rss.reg
-rw-rw-r--. 1 lmr lmr   972 2009-08-17 18:57 setuprss.bat

Those can be found under client/tests/kvm/deps directory on the most
current autotest tree.

2) Create an iso from it:

genisoimage -o rss.iso -max-iso9660-filenames -relaxed-filenames -D
--input-charset iso8859-1 rss

3) Put rss.iso under your windows iso directory.

4) Profit :)

If you want to compile the latest rss, you could try numerous things,
here are some possible routes:

1) Compile it under a windows host with mingw installed
2) Compile it under Fedora 12 with the cross compile environment
installed, you need to install at least these through yum:

mingw32-w32api
mingw32-gcc-c++
mingw32-gcc

And then do a:

i686-pc-mingw32-g++ rss.cpp -lws2_32 -mwindows -o rss.exe

I hope that was helpful. After this patch-applying spree, I gotta a
*lot* of documentation to write to our wiki :)

Cheers,

Lucas

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new  remote shell server for Windows
  2009-08-18 15:36     ` Lucas Meneghel Rodrigues
@ 2009-08-18 22:30       ` Michael Goldish
  2009-08-18 23:35         ` Lucas Meneghel Rodrigues
  2009-09-14  9:39         ` Yolkfull Chow
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Goldish @ 2009-08-18 22:30 UTC (permalink / raw)
  To: Lucas Meneghel Rodrigues; +Cc: autotest, kvm, sudhir kumar


----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:

> On Tue, Aug 18, 2009 at 7:15 AM, Michael Goldish<mgoldish@redhat.com>
> wrote:
> >
> > ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
> >
> >> Ok, very good, similarly to the previous patchset, I rebased one
> of
> >> the patches and applied the set, I am making tests with an rss
> binary
> >> generated by the cross compiler.
> >>
> >> I am testing with Winxp 32 bit, so far so good and rss.exe works
> as
> >> expected. I guess I will test more with other hosts, but I am not
> too
> >> far from applying this patchset as well.
> >>
> >> Will keep you posted!
> >
> > Note that this patchset should also allow you to install rss.exe
> > automatically using step files, so I hope that in your tests you're
> not
> > installing it manually.  I'm not expecting you to test everything
> (it
> > takes quite a while), but if you're testing anyway, better let the
> step
> > files do some work too.
> >
> > (I know we'll start using unattended installation scripts soon but
> it
> > doesn't hurt to have functional step files too.)
> >
> > Also note that using a certain qemu/KVM version I couldn't get Vista
> to
> > work with user mode.  This isn't an rss.exe problem.  In TAP mode
> it
> > works just fine.
> >
> > In any case, thanks for reviewing and testing the patchsets.
> 
> Ok Michael, turns out the win2000 failure was a silly mistake. So,
> after checking the code and going trough light testing, I applied
> this
> patchset
> 
> http://autotest.kernel.org/changeset/3553
> http://autotest.kernel.org/changeset/3554
> http://autotest.kernel.org/changeset/3555
> http://autotest.kernel.org/changeset/3556

Maybe I'm misinterpreting this, but it looks like you squashed two
patches together.  The commit titled "step file tests: do not fail
when receiving an invalid screendump" (changeset 3556) also makes
changes to kvm_tests.cfg.sample (it's not supposed to), and the patch
that's supposed to do it seems to be missing.
This is probably not important -- I just thought I should bring it to
your attention.

> Sudhir, perhaps you can try the upstream tree starting with r3556. It
> has all the changes you have asked for earlier (rss and stuff).
> 
> In order to get things all set, I suggest:
> 
> 1) Create a directory with the following contents:
> 
> [lmr@freedom rss]$ ls -l
> total 52
> -rwxrwxr-x. 1 lmr lmr 42038 2009-08-17 18:55 rss.exe
> -rw-rw-r--. 1 lmr lmr   517 2009-08-17 18:57 rss.reg
> -rw-rw-r--. 1 lmr lmr   972 2009-08-17 18:57 setuprss.bat
> 
> Those can be found under client/tests/kvm/deps directory on the most
> current autotest tree.
> 
> 2) Create an iso from it:
> 
> genisoimage -o rss.iso -max-iso9660-filenames -relaxed-filenames -D
> --input-charset iso8859-1 rss
> 
> 3) Put rss.iso under your windows iso directory.
> 
> 4) Profit :)
> 
> If you want to compile the latest rss, you could try numerous things,
> here are some possible routes:
> 
> 1) Compile it under a windows host with mingw installed
> 2) Compile it under Fedora 12 with the cross compile environment
> installed, you need to install at least these through yum:
> 
> mingw32-w32api
> mingw32-gcc-c++
> mingw32-gcc
> 
> And then do a:
> 
> i686-pc-mingw32-g++ rss.cpp -lws2_32 -mwindows -o rss.exe
> 
> I hope that was helpful. After this patch-applying spree, I gotta a
> *lot* of documentation to write to our wiki :)
> 
> Cheers,
> 
> Lucas

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows
  2009-08-18 22:30       ` Michael Goldish
@ 2009-08-18 23:35         ` Lucas Meneghel Rodrigues
  2009-09-14  9:39         ` Yolkfull Chow
  1 sibling, 0 replies; 15+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-08-18 23:35 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm

>> Ok Michael, turns out the win2000 failure was a silly mistake. So,
>> after checking the code and going trough light testing, I applied
>> this
>> patchset
>>
>> http://autotest.kernel.org/changeset/3553
>> http://autotest.kernel.org/changeset/3554
>> http://autotest.kernel.org/changeset/3555
>> http://autotest.kernel.org/changeset/3556
>
> Maybe I'm misinterpreting this, but it looks like you squashed two
> patches together.  The commit titled "step file tests: do not fail
> when receiving an invalid screendump" (changeset 3556) also makes
> changes to kvm_tests.cfg.sample (it's not supposed to), and the patch
> that's supposed to do it seems to be missing.
> This is probably not important -- I just thought I should bring it to
> your attention.
>

Oh yes, you are right, I mistakenly squashed two patches together when
I was working the patchset out. My mistake.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new  remote shell server for Windows
  2009-08-18 22:30       ` Michael Goldish
  2009-08-18 23:35         ` Lucas Meneghel Rodrigues
@ 2009-09-14  9:39         ` Yolkfull Chow
  1 sibling, 0 replies; 15+ messages in thread
From: Yolkfull Chow @ 2009-09-14  9:39 UTC (permalink / raw)
  To: Michael Goldish; +Cc: Lucas Meneghel Rodrigues, autotest, kvm, sudhir kumar

On Tue, Aug 18, 2009 at 06:30:14PM -0400, Michael Goldish wrote:
> 
> ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
> 
> > On Tue, Aug 18, 2009 at 7:15 AM, Michael Goldish<mgoldish@redhat.com>
> > wrote:
> > >
> > > ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
> > >
> > >> Ok, very good, similarly to the previous patchset, I rebased one
> > of
> > >> the patches and applied the set, I am making tests with an rss
> > binary
> > >> generated by the cross compiler.
> > >>
> > >> I am testing with Winxp 32 bit, so far so good and rss.exe works
> > as
> > >> expected. I guess I will test more with other hosts, but I am not
> > too
> > >> far from applying this patchset as well.
> > >>
> > >> Will keep you posted!


Hi Michael, so far rss works wonderful on remote login a VM and
execute some simple commands. But can we expect extend the facility to
enable it support some telnet commands, like 'wmic' ? We did need such
commands which is used for collecting guest hardware information.


> > >
> > > Note that this patchset should also allow you to install rss.exe
> > > automatically using step files, so I hope that in your tests you're
> > not
> > > installing it manually.  I'm not expecting you to test everything
> > (it
> > > takes quite a while), but if you're testing anyway, better let the
> > step
> > > files do some work too.
> > >
> > > (I know we'll start using unattended installation scripts soon but
> > it
> > > doesn't hurt to have functional step files too.)
> > >
> > > Also note that using a certain qemu/KVM version I couldn't get Vista
> > to
> > > work with user mode.  This isn't an rss.exe problem.  In TAP mode
> > it
> > > works just fine.
> > >
> > > In any case, thanks for reviewing and testing the patchsets.
> > 
> > Ok Michael, turns out the win2000 failure was a silly mistake. So,
> > after checking the code and going trough light testing, I applied
> > this
> > patchset
> > 
> > http://autotest.kernel.org/changeset/3553
> > http://autotest.kernel.org/changeset/3554
> > http://autotest.kernel.org/changeset/3555
> > http://autotest.kernel.org/changeset/3556
> 
> Maybe I'm misinterpreting this, but it looks like you squashed two
> patches together.  The commit titled "step file tests: do not fail
> when receiving an invalid screendump" (changeset 3556) also makes
> changes to kvm_tests.cfg.sample (it's not supposed to), and the patch
> that's supposed to do it seems to be missing.
> This is probably not important -- I just thought I should bring it to
> your attention.
> 
> > Sudhir, perhaps you can try the upstream tree starting with r3556. It
> > has all the changes you have asked for earlier (rss and stuff).
> > 
> > In order to get things all set, I suggest:
> > 
> > 1) Create a directory with the following contents:
> > 
> > [lmr@freedom rss]$ ls -l
> > total 52
> > -rwxrwxr-x. 1 lmr lmr 42038 2009-08-17 18:55 rss.exe
> > -rw-rw-r--. 1 lmr lmr   517 2009-08-17 18:57 rss.reg
> > -rw-rw-r--. 1 lmr lmr   972 2009-08-17 18:57 setuprss.bat
> > 
> > Those can be found under client/tests/kvm/deps directory on the most
> > current autotest tree.
> > 
> > 2) Create an iso from it:
> > 
> > genisoimage -o rss.iso -max-iso9660-filenames -relaxed-filenames -D
> > --input-charset iso8859-1 rss
> > 
> > 3) Put rss.iso under your windows iso directory.
> > 
> > 4) Profit :)
> > 
> > If you want to compile the latest rss, you could try numerous things,
> > here are some possible routes:
> > 
> > 1) Compile it under a windows host with mingw installed
> > 2) Compile it under Fedora 12 with the cross compile environment
> > installed, you need to install at least these through yum:
> > 
> > mingw32-w32api
> > mingw32-gcc-c++
> > mingw32-gcc
> > 
> > And then do a:
> > 
> > i686-pc-mingw32-g++ rss.cpp -lws2_32 -mwindows -o rss.exe
> > 
> > I hope that was helpful. After this patch-applying spree, I gotta a
> > *lot* of documentation to write to our wiki :)
> > 
> > Cheers,
> > 
> > Lucas
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-09-14  9:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-09 16:51 [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Michael Goldish
2009-08-09 16:51 ` [KVM-AUTOTEST PATCH 1/7] KVM test: Simple remote shell server for use with Windows guests Michael Goldish
2009-08-09 16:51   ` [KVM-AUTOTEST PATCH 2/7] KVM test: Batch script that prepares a Windows guest for remote access Michael Goldish
2009-08-09 16:51     ` [KVM-AUTOTEST PATCH 3/7] KVM test: Step files to setup the new remote shell server on Windows guests Michael Goldish
2009-08-09 16:51       ` [KVM-AUTOTEST PATCH 4/7] KVM test: step file tests: do not fail when receiving an invalid screendump Michael Goldish
2009-08-09 16:51         ` [KVM-AUTOTEST PATCH 5/7] KVM test: stepmaker.py: Do not attempt to use undefined variable 'version' Michael Goldish
2009-08-09 16:51           ` [KVM-AUTOTEST PATCH 6/7] KVM test: shutdown test: do not close session immediately after shutdown command Michael Goldish
2009-08-09 16:51             ` [KVM-AUTOTEST PATCH 7/7] KVM test: use homemade remote shell server (rss.exe) for all Windows guests Michael Goldish
2009-08-17 22:56 ` [Autotest] [KVM-AUTOTEST PATCH 0/7] KVM test: support for the new remote shell server for Windows Lucas Meneghel Rodrigues
2009-08-18 10:15   ` Michael Goldish
2009-08-18 13:20     ` Lucas Meneghel Rodrigues
2009-08-18 15:36     ` Lucas Meneghel Rodrigues
2009-08-18 22:30       ` Michael Goldish
2009-08-18 23:35         ` Lucas Meneghel Rodrigues
2009-09-14  9:39         ` Yolkfull Chow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.