虛擬機容錯系統(System for Fault Tolerant Virtual Machine)在近幾年來是一個非常熱門的議題,主要用於解決以虛擬機的方式架設伺服器發生虛擬機或實體機故障之後服務能夠迅速復原,或是不被中斷。不過對於虛擬機容錯系統測試自動化的議題卻鮮少有人提出。虛擬機容錯系統是一個非常複雜的系統,其所涵蓋的部分不只是應用程式的部分,還包含了實體機器的作業系統以及硬體裝置的部分。要使一個涵蓋層面非常廣的系統能有穩定、高品質的運作,測試是必不可少的。虛擬機容錯系統的測試是非常耗費時間,若要維持一定的系統品質就需要不斷的測試。在人力有限的情況下,採取手動測試並不是一個明智的選擇,採取測試自動化是必要的手段。 虛擬機容錯系統測試自動化必須模擬測試所需環境是相當困難的。在測試的過程中要能完整模擬出整個環境,如果不能百分之百模擬環境就可能導致測試案例不準確。此外,對於如何設計與實作test oracle也是虛擬機容錯系統測試自動化相當困難的環節,因為根據不同的測試案例,所使用的test oracle不盡相同,有些測試案例是透過觀察虛擬機內部的狀態作為test orcale,而有些測試案例則是觀察虛擬機容錯系統的部分元件的狀態作為test oracle。 本論文對於Fault Tolerant Service over Kernel-based Virtual Machine(FTKVM)開發一套自動化測試系統──Fault Tolerant service over Kernel-based Virtual Machine Test Framework。本系統設計一套測試自動化架構,使得開發人員可以輕鬆撰寫出測試案例,透過參數化的方式提升測試案例的彈性。再者,本系統與Jenkins結合,使得我們能達到對FTKVM回歸測試之目的。透過本系統與Jenkins,本系統能夠幫助開發團隊省去手動測試的時間、並對程式碼修正之後能夠取得快速的回饋,使系統開發者能馬上了解當前系統版本的狀況,進而達到提升系統的品質。 ;Fault tolerant virtual machine (FTVM) is a popular issue in recent years. When guest O.S., host O.S., or VM crashes, FTVM seeks out methods to keep the services alive without being aware by the clients. But the research about test automation for such a system is rare. Fault tolerant virtual machine is a complicated system, which requires the cooperation among hardware, operating systems, modified virtual machines, and monitoring components. To guarantee high quality fault tolerant virtual machine in development, testing is indispensable. Due to the complexity of testing the system, manual testing is too inefficient and time costly. Test automation is the solution to the problem. To design and build test automation for FTVM, we face three challenges. First is how to automatically setup test environment. Second is how to simulate the faults to test FTVM. The last is the design and implementation of test oracles to make sure FTVM recover as expected. This paper develops a test automation system for Fault Tolerant Service over Kernel-based Virtual Machine (FTKVM), named Fault Tolerant service over Kernel-based Virtual Machine Test Framework (FTKVMTF). FTKVMTF is a framework to let testers write test case easily. The purpose of FTKVMTF and Jenkins (a Continuous Integration tool) is to construct a regression test automation for FTKVM developers. As a results, developers of FTKVM can get immediate feedback on their changes to FTKVM in a daily build fashion.