lisa/README.md

166 строки
7.1 KiB
Markdown
Исходник Обычный вид История

2018-05-16 03:22:34 +03:00
# Test Automation for Microsoft Linux on Azure & Hyper-V
2018-05-16 02:11:18 +03:00
Automation platform for Linux images testing on Microsoft Azure and Hyper-V
## Overview
2018-05-16 03:22:34 +03:00
LISA-v2 (Linux Integrated Service Automation) is the One-stop automation solution for Linux images/kernel testing on Microsoft Azure and Hyper-V. LISA-v2 supports both Microsoft Azure and Hyper-V automation, and they use PowerShell, BASH and python scripts. Tests for feature, performance, stress and regression about new Linux Operating Systems and kernels. The test suite provides Build Verification Tests (BVTs), Azure VNET Tests and Network tests.
2018-05-16 02:11:18 +03:00
### Prerequisite
1. You must have a Windows Machine with PowerShell. Tested Platforms:
2018-05-16 03:22:34 +03:00
a. Windows 8x64
b. Windows 10x64
c. Server 2012
d. Server 2012 R2
e. Server 2016
2018-05-16 02:11:18 +03:00
2. You must be connected to Internet.
3. You must have a valid Windows Azure Subscription.
a. Subscription Name
b. Subscription ID
2018-05-16 03:22:34 +03:00
2018-05-16 02:11:18 +03:00
### Download Latest Automation Code
2018-05-16 03:22:34 +03:00
1. Checkout from https://github.com/LIS/LISAv2.git to your local storage
2018-05-16 02:11:18 +03:00
### Download Latest Azure PowerShell
2018-05-16 03:22:34 +03:00
1. Download Web Platform Installer from : http://go.microsoft.com/fwlink/p/?linkid=320376&clcid=0x409
2. Start Web Platform Installer and select Azure PowerShell and proceed for Azure PowerShell Installation.
2018-05-16 02:11:18 +03:00
### Authenticate Your Machine with Your Azure Subscription
There are two ways to authenticate your machine with your subscription.
2018-05-16 04:28:53 +03:00
1. Azure AD method
2018-05-16 02:11:18 +03:00
This creates a 12 Hours temporary session in PowerShell, in that session, you are allowed to run Windows Azure Cmdlets to control / use your subscription. After 12 hours you will be asked to enter username and password of your subscription. This may create problems long running automations, hence we use certificate method.
2018-05-16 04:28:53 +03:00
2. Certificate Method.
2018-05-16 02:11:18 +03:00
To learn more about how to configure your PowerShell with your subscription, please visit [here](http://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/#Connect).
### Download Public Utilities
2018-05-16 04:28:53 +03:00
Download Putty executables from http://www.putty.org and keep them in `.\TestScripts\Tools`. You should have the following utilities:
2018-05-16 02:11:18 +03:00
2018-05-16 03:22:34 +03:00
<20> plink.exe
<20> pscp.exe
<20> putty.exe
<20> puttygen.exe
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
Download dos2unix executables from http://sourceforge.net/projects/dos2unix/ and keep them in `.\TestScripts\Tools`. You should have the following utilities:
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
<20> dos2unix.exe
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
Download 7-zip executable from http://www.7-zip.org/ ( Direct Download Link : http://www.7-zip.org/a/7za920.zip ) and keep them in `.\TestScripts\Tools`. You should have the following utility:
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
<20> 7za.exe
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
### Update GlobalConfigurations.xml file
1. Setup Subscription details.
Go to Global > Azure and update following fields :
a. SubscriptionID
b. SubscriptionName
c. ManagementEndpoint
d. Environment
e. ARMStorageAccount
2018-05-16 02:11:18 +03:00
Example :
```xml
2018-05-16 04:28:53 +03:00
<Azure>
<Subscription>
<SubscriptionID>2cd20493-fe97-42ef-9ace-ab95b63d82c4</SubscriptionID>
<SubscriptionName>YOUR_SUBSCRIPTION_NAME</SubscriptionName>
<ManagementEndpoint>https://management.core.windows.net</ManagementEndpoint>
<Environment>AzureCloud</Environment>
<ARMStorageAccount>ExistingStorage_Standard</ARMStorageAccount>
</Subscription>
2018-05-16 02:11:18 +03:00
```
2018-05-16 04:28:53 +03:00
2. Save file.
2018-05-16 02:11:18 +03:00
### Prepare VHD to work in Azure
`Applicable if you are uploading your own VHD with Linux OS to Azure.`
2018-05-16 04:28:53 +03:00
TODO: Need to revise ******
2018-05-16 03:22:34 +03:00
A VHD with Linux OS must be made compatible to work in Azure environment. This includes <20>
2018-05-16 02:11:18 +03:00
2018-05-16 04:28:53 +03:00
1. Installation of Linux Integration Services to Linux VM (if already not present)
2. Installation of Windows Azure Linux Agent to Linux VM (if already not installed.)
3. Installation of minimum required packages. (Applicable if you want to run Tests using Automation code)
2018-05-16 02:11:18 +03:00
Please follow the steps mentioned at:
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-create-upload-vhd/
### Prepare VHD to work with Automation code.
`Applicable if you are using already uploaded VHD / Platform Image to run automation.`
To run automation code successfully, you need have following packages installed in your Linux VHD.
2018-05-16 04:28:53 +03:00
1. iperf
2. mysql-server
3. mysql-client
4. gcc
5. gcc-c++
6. bind
7. bind-utils
8. bind9
9. python
10. python-pyasn1
11. python-argparse
12. python-crypto
13. python-paramiko
14. libstdc++6
15. psmisc
16. nfs-utils
17. nfs-common
18. tcpdump
2018-05-16 02:11:18 +03:00
### Create SSH Key Pair
2018-05-16 03:22:34 +03:00
`PublicKey.cer <20> PrivateKey.ppk`
2018-05-16 02:11:18 +03:00
A Linux Virtual machine login can be done with Password authentication or SSH key pair authentication. You must create a Public Key and Private key to run automation successfully. To learn more about how to create SSH key pair, please visit [here](http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-use-ssh-key/).
After creating Public Key (.cer) and putty compatible private key (.ppk), you must put it in your `automation_root_folder\ssh\` folder and mention their names in Azure XML file.
### VNET Preparation
`Required for executing Virtual Network Tests`
#### Create a Virtual Network in Azure
A virtual network should be created and connected to Customer Network before running VNET test cases. To learn about how to create a virtual network on Azure, please visit [here](https://azure.microsoft.com/documentation/articles/vpn-gateway-site-to-site-create/).
#### Create A customer site using RRAS
2018-05-16 03:22:34 +03:00
Apart from Virtual Network in Azure, you also need a network (composed of Subnets and DNS server) to work as Customer Network. If you don<6F>t have separate network to run VNET, you can create a virtual customer network using RRAS. To learn more, please visit [here](https://msdn.microsoft.com/en-us/library/dn636917.aspx).
2018-05-16 02:11:18 +03:00
## How to Start Automation
Before starting Automation, make sure that you have completed steps in chapter [Prepare Your Machine for Automation Cycle](#prepare)
2018-05-16 04:28:53 +03:00
1. Start PowerShell with Administrator privileges
2. Navigate to folder where automation code exists
3. Issue automation command
2018-05-16 02:11:18 +03:00
#### Automation Cycles Available
2018-05-16 04:28:53 +03:00
TODO: Revision *****
1. BVT
2. NETWORK
3. VNET
4. E2E-1
5. E2E-DISK
6. E2E-TIMESYNC
7. E2E-TIMESYNC-KERNBANCH
8. WORDPRESS1VM
9. WORDPRESS4VM
10. DAYTRADER1VM
11. DAYTRADER4VM
2018-05-16 02:11:18 +03:00
12. NETPERF
13. IOPERF-RAID
14. IOPERF-LVM
#### Supported Azure Mode
2018-05-16 04:28:53 +03:00
- AzureResourceManager, if the value is present in the SupportedExecutionModes tag of the case definition
2018-05-16 02:11:18 +03:00
#### Command to Start any of the Automation Cycle
2018-05-16 04:28:53 +03:00
TODO: Revision ***
2018-05-16 03:22:34 +03:00
.\AzureAutomationManager.ps1 -xmlConfigFile .\Azure_ICA_ALL.xml -runtests -email <20>Distro <DistroName> -cycleName <TestCycleToExecute> -UseAzureResourceManager
2018-05-16 02:11:18 +03:00
#### More Information
2018-05-16 04:28:53 +03:00
For more details, please refer to the documents [here](https://github.com/LIS/LISAv2/tree/master/Documentation).