Previous Lecture Complete and continue  

  Lesson 1: Hello World

13 comments
Serdar Guler
print("hello-world")
Serdar Guler
ThisIsBetterThanTheShitTheyTeachAtSchool!!!!!!!!!!
Robert de los santos
i didnt know the name of the class to join your class room in repl.it, please send me the info thank
you.

# Make sure to print out 'Hello, World!'

print("Hello, World!")

Miroslav
I can't write the code in this "trinket" stuff. Using 64-bit firefox on win10. In Opera everything is OK. Probably some extension on firefox is breaking the site
Ereatara Kokiri
Awesome
Arief Rosadi
I love it!!!
manuel perrotta
great!!!
Seyma Sean
Best tutorial ever! Thump up for you bro : )
Md Abdullah Al Maruf
LOve it.
Thabo Modisegmail.com
Thanks bro this is really cool. Iam having the time of my life. I feel like a kid again lol.
Rafeh Qazi
Oh I am so excited for you haha! The most exciting part is that it only gets more interesting over time...
Mahesh Dudhani
Can you please help with below script is there any errors?
#!/usr/bin/python
# This is main file for SRIOV Automation tests.

import os, sys, re, time, pexpect, string, random, threading, thread
from os.path import exists
from SRIOV_config import *
from SRIOV_test_modules import *

def main():
if (ifConfig == 0):
# Cleanup on DUT before starting test
log = "Performing Cleanup on DUT"
copylog(log, logFile)
pre_cleanup(DUTmgmtIP, numVMs, logFile)

# Cleanup on PEER before starting test
log = "Performing Cleanup on PEER"
copylog(log, logFile)
pre_cleanup(PEERmgmtIP, numVMs, logFile)

#Find DUT ethernet interface
dutEth = find_eth (dutMAC, DUTmgmtIP, logFile)
if (dutEth == FAIL):
print_results (FAIL, '+++++++++++ find_eth_DUT +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ find_eth_DUT +++++++++++', logFile)

# Find PEER ethernet interface
peerEth = find_eth (peerMAC, PEERmgmtIP, logFile)
if (peerEth == FAIL):
print_results (FAIL, '+++++++++++ find_eth_PEER +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ find_eth_PEER +++++++++++', logFile)

# Check if SRIOV enabled on DUT, if not enable it
ret = check_enable_SRIOV (dutMAC, DUTmgmtIP, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ check_enable_SRIOV_DUT +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ check_enable_SRIOV_DUT +++++++++++', logFile)

# Check if SRIOV enabled on PEER, if not enable it
ret = check_enable_SRIOV (peerMAC, PEERmgmtIP, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ check_enable_SRIOV_PEER +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ check_enable_SRIOV_PEER +++++++++++', logFile)

# Load DUT interface with VFs
vfMAClistDUT = load_VFs (dutEth, DUTmgmtIP, logFile)
if (vfMAClistDUT == FAIL):
print_results (FAIL, '+++++++++++ load_VFs_DUT +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ load_VFs_DUT +++++++++++', logFile)

# Load PEER interface with VFs
vfMAClistPEER = load_VFs (peerEth, PEERmgmtIP, logFile)
print vfMAClistPEER
if (vfMAClistPEER == FAIL):
print_results (FAIL, '+++++++++++ load_VFs_PEER +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ load_VFs_PEER +++++++++++', logFile)

time.sleep(60)

# Find pciIDs for all the VFs created after loading driver on DUT
pciIDlistDUT = get_pci_ids (dutEth, vfMAClistDUT, DUTmgmtIP, logFile)
print pciIDlistDUT
if (pciIDlistDUT == FAIL):
print_results (FAIL, '+++++++++++ get_pci_ids_DUT +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ get_pci_ids_DUT +++++++++++', logFile)

# Find pciIDs for all the VFs created after loading driver on PEER
pciIDlistPEER = get_pci_ids (peerEth, vfMAClistPEER, PEERmgmtIP, logFile)
print pciIDlistPEER
if (pciIDlistPEER == FAIL):
print_results (FAIL, '+++++++++++ get_pci_ids_PEER +++++++++++', logFile)
sys.exit(-1)
else:
print_results (PASS, '+++++++++++ get_pci_ids_PEER +++++++++++', logFile)

# Copy VM image to DUT from NFS and create clones for number of VMs to be created.
ret = copy_VM_images (DUTmgmtIP, dutVMimgPath, nfsVMimgPATH, nfsIP, VMimgName, mountDIR, numVMs, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ copy_VM_images_DUT +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ copy_VM_images_DUT +++++++++++', logFile)

# Copy VM image to PEER from NFS and create clones for number of VMs to be created.
ret = copy_VM_images (PEERmgmtIP, peerVMimgPath, nfsVMimgPATH, nfsIP, VMimgName, mountDIR, numVMs, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ copy_VM_images_PEER +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ copy_VM_images_PEER +++++++++++', logFile)

# Configure VMs in DUT and boot them to OS
ret = configure_VMs (DUTmgmtIP, vfMAClistDUT, pciIDlistDUT, numVMs, dutVMips, VMimgName, dutVMimgPath, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ configure_VMs_DUT +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ configure_VMs_DUT +++++++++++', logFile)

# Configure VMs in PEER and boot them to OS
ret = configure_VMs (PEERmgmtIP, vfMAClistPEER, pciIDlistPEER, numVMs, peerVMips, VMimgName, peerVMimgPath, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ configure_VMs_PEER +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ configure_VMs_PEER +++++++++++', logFile)

time.sleep(osBootTime)

else:
log = "Test Configuration is already done. Proceed Further !!!"
copylog(log, logFile)

# Start iperf server on Peer VMs after assigning IPs to interfaces
ret = configure_vm_IPs_start_iperf_ser_peer (PEERmgmtIP, numVMs, VMimgName, vmPass, dutTestMAC, peerVMips, logFile)
if (ret == FAIL):
print_results (FAIL, '+++++++++++ configure_vm_IPs_start_iperf_ser_peer +++++++++++', logFile)
sys.exit(-1)
elif (ret == PASS):
print_results (PASS, '+++++++++++ configure_vm_IPs_start_iperf_ser_peer +++++++++++', logFile)

# Start iperf client threads from each DUT VM
jobs = []
waitCount = 1
TH_lock = threading.Lock()
for num in xrange(numVMs):
vmName = "%s_%d" % (VMimgName, num)
DUTvmIP = dutVMips[num]
PEERvmIP = peerVMips[num]
thread = threading.Thread(target=configure_vm_IPs_run_iperf_client,args=(DUTmgmtIP, vmName, vmPass, peerTestMAC, DUTvmIP, PEERvmIP, logFile, testRunTime, iterRunTime, TH_lock))
jobs.append(thread)
time.sleep(1)

# Start the threads (i.e. calculate the random number lists)
for j in jobs:
j.start()

# Ensure all of the threads have finished
for j in jobs:
j.join()

print ""
print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
print ""
print "++++++++++++++++++++++++++ SR-IOV AUTOMATION IS COMPLETED +++++++++++++++++++++++++++++++"
print ""
print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

main()
Rafeh Qazi
Hmm... Could you explain a little bit more? I would like to help you but I don't have any context.