It worked on my desk
A technician finishes setting up a new office. She pings one laptop. It answers. She says: done.
On Monday, the printer cannot be reached from the classrooms. She tested one path, and the problem was on another.
A good test covers every path that matters, and writes down what it found.
Key words
| Word | What it means |
|---|---|
| Test plan | a list of what to test, what you expect, and how to check |
| Functionality | whether something does the job it was built to do |
| Performance | how well it does the job: how fast and how reliably |
| Script | a short program that runs commands for you |
| Latency | the delay for a packet to travel, in milliseconds |
| Packet loss | packets that never arrive |
| Ping | a tool that sends small packets and times the replies |
| Log | a written record of what happened and when |
| Packet | a small piece of data sent over a network |
| Network | computers and devices joined so they can share data |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can test a network for functionality and performance with a short script, and record every result so it can improve the network.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Two kinds of test
| Kind | The question | An example test | A pass looks like |
|---|---|---|---|
| Functionality | Does it work at all? | Can h1 reach h2? | A reply comes back |
| Functionality | Is the closed door still closed? | Can h1 reach the management network? | No reply: that is the right answer |
| Performance | How quick is it? | The average ping time | Under the limit in the plan |
| Performance | How reliable is it? | Packets lost out of 100 | None, or under the limit |
The cells students fill in are left blank in this preview.
Write down what you expect first
A test plan lists each test and the answer you expect. A FAIL is not always bad. If h1 must not reach the management network, then no reply is a pass for the plan.
Without the expected answer, you cannot tell a good result from a bad one.
A script that tests for you
Typing four pings is slow, and people forget one. A script does the same checks every time.
The next command is a loop (steps repeated for each item). For each pair of host and address it sends one ping, then prints PASS or FAIL. The lab routes were added in the earlier lesson. Press Start the lab.
Run the functionality tests
for t in "h1 10.0.1.1" "h1 10.0.3.2" "h2 10.0.1.2" "h1 10.0.99.2"; do set -- $t; if sudo ip netns exec $1 ping -c 1 -W 1 $2 >/dev/null 2>&1; then echo "PASS $1 to $2"; else echo "FAIL $1 to $2"; fi; doneA command for the lesson’s lab terminal. It is shown here and not run.