Successfully reported this slideshow.

Jython for Embedded Software Validation


Published on

Presented at Pycon italy 2010

Published in: Technology, Business
  • > Validation, Testing & Code Maintainence Services for BIOS, IPMI, Embedded OS, Firmware Device & Device Drivers, contact or +91 96000 10071
    American Megatrends a global company based in Atlanta is an incubation partner with various semiconductor vendors for Validation & Testing Services.

    Embedded OS and System Firmware validation and testing services :
    (1) BIOS validation and testing services.
    (2) IPMI validation services
    (3) Pre-boot and Option ROM Utilities
    (4) UEFI Utilities & Drivers
    (5) Software integration, feature verification and system verification for Embedded OS (Windows, Embedded Linux, Android, Meego, Chrome)
    (6) Board Support Package (BSP) Validation & testing Services
    (7) Firmware Validation, Testing and Code Maintenance Services
    (8) PC and Server Diagnostics for UEFI and Legacy environment ( )
    (9) Desktop & Embedded Mobile OS Validation Services for “Intel’s PineView Platform”. (MeeGo, Chrome OS, WinCE 6.0 & Embedded Linux, Home Server)
    (10) Embedded Mobile OS Validation Services for “Intel’s Cougar Point Platform”. (MeeGo, Chrome OS, WinCE 6.0 & Embedded Linux, Home Server)

    Please do let us know if any you have any validation and testing services that require our assistance.
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Jython for Embedded Software Validation

  1. 1. Jython for Embedded Software Validation<br />Raniero Virgilio<br />IAG/ECG/PPD SW <br />Pycon Quattro, 8/5/2010<br />
  2. 2. Raniero Virgilio<br />My Job <br />Software Engineer in Intel Shannon, Ireland<br />Responsible for Test Automation infrastructure<br />My Team<br />PPD (Performance Product Division)<br />Embedded Software<br />Complete SOCs for security, communications, storage and embedded designs<br /><br />
  3. 3. Agenda<br />Validation in embedded systems<br />Runtime Plug-in model<br />Runtime Plug-in model with Jython<br />Jython and Eclipse<br />Results<br />
  4. 4. Validation in embedded systems<br />A challenging environment<br />Typical scenario<br />Requirements and solutions<br />
  5. 5. A challenging environment<br />Multiple hw/sw deployments<br />Configuration set up needs to be fast and reliable<br />Support for different OS types and versions<br />Consistent cooperation<br />Several teams working on the same infrastructure<br />Synchronization with overseas groups<br />
  6. 6. Test Automation scenario<br />Test <br />Code<br />XML-RPC session<br />Server1 (Windows)<br />Traffic Generator 1<br />XML-RPC session<br />Traffic Generator 2<br />Server2 (Windows)<br />Telnet session<br />Test <br />Driver<br />DUT1 <br />(Linux/Windows/FreeBSD)<br />Test Execution<br />Reports<br />XML-RPC <br />session<br />Telnet session<br />Test <br />Suites<br />DUT2<br />(Linux/Windows/FreeBSD)<br />Telnet session<br />DUT3<br />(Linux/Windows/FreeBSD)<br />
  7. 7. Test Automation requirements<br />Programming language<br />Platform-independent<br />Libraries for connectivity and string manipulation<br />Test Framework design<br />OOP to maximize reusability of test code<br />Platform runtime extendibility<br />Sustainable implementation<br />An effective interface between test execution (local to DUT) and test reporting (distributed)<br />Customizable open source solution<br />
  8. 8. Proposed solution<br />Programming language<br />Python<br />telnetlib, xmlrpclib, SimpleXMLRPCServer<br />re,xml.dom.minidom<br />Test Framework design<br />Runtime plug-in model<br />Sustainable implementation<br />Jython embedded in Eclipse<br />Jython is a Python interpreter written in 100% pure Java<br />
  9. 9. Runtime plug-in model<br />Definition<br />Design Pattern<br />
  10. 10. Runtime Plug-in Model<br />The term plug-in refers to a type of program that contributes code to the system and adds a special capability to it.<br />The plug-in is unknown at compile-time of the application for which the plug-in is designed.<br />Plug-ins are dynamically plugged into the application they are designed for at runtime<br />The key for this model is Dynamic Code Loading<br />
  11. 11. Design Pattern<br /><ul><li>Extendibility
  12. 12. Application capabilities are defined by the supported Plug-in
  13. 13. Plug-in can be loaded and unloaded at runtime
  14. 14. Plug-in development
  15. 15. Each Plug-in shall implement a specified interface
  16. 16. The plug-in delegates the Application for high-level services
  17. 17. Parallel life-cycle
  18. 18. Application and Plug-ins can be developed independently </li></li></ul><li>Runtime Plug-in Model with Jython<br />Dynamic code loading in Java and Jython<br />Multithreading<br />
  19. 19. Dynamic code loading in Java<br /><ul><li>Runtime source compilation
  20. 20. StandardJavaFileManager handles the source code
  21. 21. JavaCompiler executes the compilation and creates a class file
  22. 22. DiagnosticCollector gathers compilation information
  23. 23. Class file deployment
  24. 24. A new Classloader has to be defined
  25. 25. It need to extend the previous one with the new class file</li></ul>Client<br />
  26. 26. Dynamic code loading in Jython<br /><ul><li>One step task
  27. 27. The PluginHandler instantiates one PythonInterpreter
  28. 28. The Plug-in path is added in the PythonInterpretersys.path
  29. 29. The Plug-in is imported in the embedded Python environment
  30. 30. Lower complexity
  31. 31. Implementation is much easier
  32. 32. Code can be modified “on-the-fly” and reloaded
  33. 33. First time Plug-in loading is usually quicker on Jython</li></ul>Client<br />
  34. 34. Multithreaded environment<br /><ul><li>Parallel PluginHandlers
  35. 35. Independent Jython environments’ setups
  36. 36. Each PluginHandler defines an autonomous environment</li></ul>Java Thread<br /><ul><li>Multiple task execution
  37. 37. When PluginHandler invokes a run() the execution is encapsulated in a Java Thread
  38. 38. Plug-ins expand the application concurrently</li></ul>Client<br />
  39. 39. Jython and Eclipse<br />XTP architecture<br />The Execution Engines<br />The JythonExchanger<br />
  40. 40. The eXtendible Test Platform (XTP)<br />Java<br />Jython<br />
  41. 41. The Execution Engine in XTP<br /><ul><li>XTP
  42. 42. provides high-level test services (logging, reporting, multithreading) and an interface with frontend
  43. 43. Execution Engine
  44. 44. a self-contained software package, written in Python, that implements the actual test logic and expands XTP enabling communication of the test platform with DUTs, servers and test equipments</li></li></ul><li>Plugging an Execution Engine<br />XML-based Manifest<br />jythonExchanger<br /><ul><li>A PythonInterpreteris created by XTP
  45. 45. The activation sequences contained in the EE Manifest are executed in the PythonInterpreter
  46. 46. An instance of the (Java) JythonInterpreter class is created by XTP and deployed into the relevant PythonInterpreter</li></li></ul><li>The jythonExchanger<br /><ul><li>The jythonExchanger is the interface between the EE and the XTP environment
  47. 47. Each EE uses it to access XTP high-level features
  48. 48. XTP infrastructure uses it to retrieve test results from EEs and show them in graphs and reports
  49. 49. The overall consistency of the system is assured by the Jython characteristic to be a 100% pure Java implementation. </li></li></ul><li>Results<br />Main benefits<br />Common risks<br />
  50. 50. Sustainable architecture<br /><ul><li>Example: load/unload 5 plug-ins at runtime
  51. 51. Memory request increases without “exploding”
  52. 52. Memory is freed when plug-ins are deactivated</li></li></ul><li>Major benefits<br />“Calibrate your technology”<br />Choose the solution that best fits your needs<br />Python threads or Java threads (or Eclipse Jobs)? <br />Transparent Python layer on DUTs<br />XML-RPC Server + os.popen() have small CPU overhead<br />Plug-in lifecycle<br />Runtime plug-ins promote validation through cooperation<br />Short rump-up time<br />Perl users start using Python very intuitively<br />
  53. 53. Common risks<br />“Design your architecture”<br />Test planning<br />To make the most of the Plug-in design pattern, point out common test domains in advance<br />Long-term investment<br />Platform stability requires a significant effort<br />Keep code under control<br />Review carefully test code before integrating it<br />Right-Size your hardware<br />Concurrent executions may require performing machines<br />
  54. 54. Q&A<br />