2014-06-25 03:35:28 +04:00
<# -------------Create Deployment Start------------------ #>
Import-Module . \ TestLibs \ RDFELibs . psm1 -Force
$Subtests = $currentTestData . SubtestValues
$SubtestValues = $Subtests . Split ( " , " )
$result = " "
$testResult = " "
$resultArr = @ ( )
$isDeployed = DeployVMS -setupType $currentTestData . setupType -Distro $Distro -xmlConfig $xmlConfig
if ( $isDeployed )
{
2015-10-19 19:25:07 +03:00
#region EXTRACT ALL INFORMATION ABOUT DEPLOYED VMs
$allVnetData = GetVNETDetailsFromXMLDeploymentData -deploymentType $currentTestData . setupType
$vnetName = $allVnetData [ 0 ]
$subnet1Range = $allVnetData [ 1 ]
$subnet2Range = $allVnetData [ 2 ]
$vnetDomainDBFilePath = $allVnetData [ 3 ]
$vnetDomainRevFilePath = $allVnetData [ 4 ]
$dnsServerIP = $allVnetData [ 5 ]
$SSHDetails = " "
foreach ( $vmData in $allVMData )
{
if ( $SSHDetails )
{
$SSHDetails = $SSHDetails + " ^ $( $vmData . PublicIP ) " + ':' + " $( $vmData . SSHPort ) "
}
else
{
$SSHDetails = " $( $vmData . PublicIP ) " + ':' + " $( $vmData . SSHPort ) "
}
}
#endregion
2014-06-25 03:35:28 +04:00
#region CONFIGURE VNET VMS AND MAKE THEM READY FOR VNET TEST EXECUTION...
2015-10-19 19:25:07 +03:00
# NO PRECONFIGURATION NEEDED FOR THIS TEST.
2014-06-25 03:35:28 +04:00
$isAllConfigured = " True "
#endregion
#region TEST EXECUTION
if ( $isAllConfigured -eq " True " )
{
try
{
2015-10-19 19:25:07 +03:00
$ErrCount = 0
foreach ( $vmData in $allVMData )
{
LogMsg " Checking : $( $vmData . Rolename ) "
$out = RunLinuxCmd -ip $vmData . PublicIP -port $vmData . SSHPort -username $user -password $password -command " $ifconfig_cmd -a " -runAsSudo
LogMsg $out -LinuxConsoleOuput
if ( $out -imatch $vmData . InternalIP )
{
LogMsg " Expected DIP : $( $vmData . InternalIP ) ; Recorded DIP : $( $vmData . InternalIP ) ; "
LogMsg " $( $vmData . Rolename ) has correct DIP.. "
}
else
{
LogErr " INCORRECT DIP DETAIL : $( $vmData . Rolename ) "
$ErrCount = $ErrCount + 1
}
}
if ( $ErrCount -eq 0 )
2014-06-25 03:35:28 +04:00
{
$testResult = " PASS "
}
2015-10-19 19:25:07 +03:00
else
2014-06-25 03:35:28 +04:00
{
$testResult = " FAIL "
}
}
catch
{
$ErrorMessage = $_ . Exception . Message
LogErr " EXCEPTION : $ErrorMessage "
}
Finally
{
$metaData = " "
if ( ! $testResult )
{
$testResult = " Aborted "
}
$resultArr + = $testResult
$resultSummary + = CreateResultSummary -testResult $testResult -metaData $metaData -checkValues " PASS,FAIL,ABORTED " -testName $currentTestData . testName # if you want to publish all result then give here all test status possibilites. if you want just failed results, then give here just "FAIL". You can use any combination of PASS FAIL ABORTED and corresponding test results will be published!
}
}
else
{
LogErr " Test Aborted due to Configuration Failure.. "
$testResult = " Aborted "
$resultArr + = $testResult
}
#endregion
}
else
{
$testResult = " Aborted "
$resultArr + = $testResult
}
$result = GetFinalResultHeader -resultarr $resultArr
#Clean up the setup
2015-10-19 19:25:07 +03:00
DoTestCleanUp -result $result -testName $currentTestData . testName -deployedServices $isDeployed -ResourceGroups $isDeployed
2014-06-25 03:35:28 +04:00
#Return the result and summery to the test suite script..
2015-10-19 19:25:07 +03:00
return $result