Slide 1

Slide 1 text

TESTING FIBER OPTICS WITH RUBY Sergio Freire

Slide 2

Slide 2 text

What?  GPON in 30 seconds  SUT  Challenges  The tools  Testing approach  Test scenario  Code (really?)  Results & Learned lessons 2

Slide 3

Slide 3 text

Ruby and Fiber Optics? Why not? 3

Slide 4

Slide 4 text

Terminology  GPON - Gigabit Passive Optical Network  OLT - Optical Line Terminal  ONT - Optical Network Terminal 4

Slide 5

Slide 5 text

GPON in 30 seconds Source: AlticeLabs 5

Slide 6

Slide 6 text

GPON in 30 seconds 6

Slide 7

Slide 7 text

The BIG challenge  Automate testing… for everything! 7

Slide 8

Slide 8 text

SUT – System Under Test  OLT + ONTs + … + … + ??? We need to simplify & focus! 8

Slide 9

Slide 9 text

SUT – System Under Test  SUT  OLT OS, running in a OLT But… there are several OLT types…. OLT1T3 OLT1T0 9

Slide 10

Slide 10 text

OLT - quick overview Allows up to 16K clients! OLT1T3 10

Slide 11

Slide 11 text

SUT – kind of  OLT is not just A hardware  Each card has its own hardware revision  OLT OS is a “mix” We need to get back to reality! 11

Slide 12

Slide 12 text

Some other challenges  “Resistence”  Manual Tests  QA vs Devel  Waterfall  Tools & Methodologies 12

Slide 13

Slide 13 text

Implementation Challenges  Build process not fully automated  Firmware uploading takes too much  OLT: up to 15min  ONTs: up to 15min, each  Scenario initialization just takes too loooong  We really needed Continuous Integration… 13

Slide 14

Slide 14 text

HOW WE DID IT

Slide 15

Slide 15 text

OLT 1T3 hardware OLT OS ONT SFU ONT RGW Traffic Generator “APIs”: • SNMP • CLI (telnet/ssh/rs232) • Web • XML (http) GBe Gbe Firmware repository (OLT, ONT) ONT xxx GBe … optical (OMCI) GBe FTP ethernet switch uplink LOGIC DIAGRAM

Slide 16

Slide 16 text

The Tools - before  HP Quality Center  JIRA (partially) 16

Slide 17

Slide 17 text

The Tools - after  JIRA + Xray add-on  Ruby & Cucumber  Jenkins 17

Slide 18

Slide 18 text

Ruby - a perfect choice  Simple yet powerfull  Many libraries available for free  snmp  TCL  SSH, Telnet, (S)FTP, …  HTTP  Logging  Etc, etc … 18

Slide 19

Slide 19 text

Approach  Focus on Regression Testing! 1. Start from the start 2. Share documentation & know-how 3. Identify core features/requirements 4. Make some ruby gems 5. Implement some automatic tests 6. Measure and *share* progress 7. Iterate Share and involve everyone! Testing makes everyone win. 19

Slide 20

Slide 20 text

Why regression?  Increasing complexity, short release cycles  Ensure *no surprises*  Easy to sell! Sometimes there is no time… 20

Slide 21

Slide 21 text

Time to get hands dirty  Use semi-automated prebuilt builds  Scenario initialization optimization  Don’t upload firmware if already there  Quick reset configuration  Not perfect but it works most times!  OLT equipment type and scenario completely configurable in YAML file  21

Slide 22

Slide 22 text

Ruby gems  Generic support functions  OLT basic interface  Files (ftp, …)  CLI (telnet/ssh)  Traffic Generator  TCL  => make some wrapping, pre-record traffic 22

Slide 23

Slide 23 text

Testing scenario Test Execution (Jenkins) OLT1T3 Many ONT RGW’s Traffic Generator SVN Build repository Firmware OLT, ONTs Tests source code •Execution evidences •Test Management •Requirement Coverage Many ONT SFU’s 23

Slide 24

Slide 24 text

Workflow Implement tests in Ruby + Cucumber Validate locally and commit to SVN Run the tests using Jenkins Import the results to JIRA + Xray Create and link tests + requirements 24

Slide 25

Slide 25 text

And now…  Where to start from?  Implement protocols from scratch? ? 25

Slide 26

Slide 26 text

Build an API in “minutes”  OLT CLI  typical commands: > /equipment/boards/show > /backup-manager/show > /backup-manager/import --param1=value1 … --paramN=valueN Ruby Metaprogramming to the rescue! 26

Slide 27

Slide 27 text

Build an API in “minutes”  Typical OLT CLI commands > /equipment/boards/show > /backup-manager/show > /backup-manager/import --param1=value1 … --paramN=valueN .show_equipment_boards .show_backupmanager .import_backupmanager({:param1 => value1, ..., :paramN => valueN}) 27

Slide 28

Slide 28 text

Build an API in “minutes” 28

Slide 29

Slide 29 text

Build an API in “minutes” {:title=>"onusprofiles", :data=> {"ID"=> {"1"=>{"name"=>"sfu", "admin"=>"enable", "vendor"=>"ptin", "model"=>"sfu", "pon"=>"1", "eth"=>"1", "rf"=>"1", "voip"=>"0", "e1"=>"0", "veip"=>"0"}, "2"=>{"name"=>"4ge-2fxs", "admin"=>"enable", "vendor"=>"ptin", "model"=>"4ge-2fxs", "pon"=>"1", "eth"=>"4", "rf"=>"1", "voip"=>"2", "e1"=>"0", "veip"=>"0"}, … }}}} Parsing answers 29

Slide 30

Slide 30 text

Cucumber step examples Given ONT in slot "" and pon "" with id "" is upgraded with version "“ And the OLT equipment does not have any services configured And a ONU profile exists with |state |name | vendor |model |pon|eth|rf|voip|e1|veip| |enabled |RGWs/rf |PTIN |RGWs/rf |1 |4 |0 |2 |0 |1 | |enabled |SFU_PTIN |PTIN |SFU |1 |1 |1 |0 |0 |0 | |enabled |teste |PTIN |teste |1 |1 |0 |0 |0 |0 | Then ONU present in slot "" and pon "" with id "" should have the version "" commited and activated 30

Slide 31

Slide 31 text

Cucumber step examples (2) Given the OLT equipment does not have any services configured And an Ethernet interface exists in slot "", port "" with mtu "" and state "enabled“ When the traffic with the following characteristics is created in generator |stream_name|svlan |cvlan |src_MAC |dest_MAC |src_IP |dest_IP |rate |frame_size|downstream_port|upstream_port| |downstream1 |100 | |00:00:08:00:AA:01|00:00:08:00:AB:01|192.0.0.1 |192.0.1.1 |1000000|1000|1|2| |upstream1 |3100 |100 |00:00:08:00:AB:01|00:00:08:00:AA:01|192.0.1.1 |192.0.0.1 |1000000|1000|2|1| And the traffic configured in generator runs for "5" seconds Then the traffic stream named "downstream1" should have no losses 31

Slide 32

Slide 32 text

Results - Key numbers After 3 months 2 years later… Requirements validated 13 189 Automatic Tests 63 5143 Does it still seems impossible? No! 32

Slide 33

Slide 33 text

Results – Before and After 0 5 10 15 20 25 30 35 Time to execute regression tests Days Before After Average distinct tests executed per build Before After + 744 % Total regression tests executed Before After + 811 % 0 5 10 15 20 25 30 35 Effort need to execute regression testing Man Days Before After 33

Slide 34

Slide 34 text

Requirement coverage evolution 34

Slide 35

Slide 35 text

Results & Learned Lessons  Ruby is perfect! Good side effects:  Hardware stress tests  Testing team now mainly writes code  Brake human barriers, use APIs   LISTEN and involve everyone  Show how to fish  Make things that matter => real benefits!  Start simple, not perfect  Use the right tools (Ruby, Cucumber, Jenkins, JIRA, Xray add-on) 35

Slide 36

Slide 36 text

Ruby and Fiber Optics? Of course! 36

Slide 37

Slide 37 text

Q/A Thanks! Sergio Freire Xray Product Manager sergio.freire@xpand-it.com @darktelecom 37