Commit Graph

128 Commits

Author SHA1 Message Date
Neels Hofmeyr e349320992 cosmetic: early exit instead of if-cascade
It appears that during some error conditions, the socket will not be in the tcp
socket debug tracking list, and on top of an exception this barfs as well.
Let's not care about the tcp debug list and avoid confusing error messages.

Change-Id: Ib7b0e45fa1f5551da2fc81b71dcc227eee533f44
2017-03-06 15:31:08 +01:00
Neels Hofmeyr cb320b8ddf debug_tcp_sockets: clearly mark as global var
Change-Id: I56e26590ea380c7deab7ce132d688b37eb2d11a3
2017-03-06 15:31:08 +01:00
Neels Hofmeyr ac0b59d93a debug: also output nr of open file descriptors for 'tcp debug'
Change-Id: I8a583df549f3e2b79068fd8cd32b75473539410d
2017-03-06 15:31:08 +01:00
Neels Hofmeyr 2bdab3d291 tcp debugging: allow switching on TCP debug by env var
Print monitoring info about TCP sockets when the env var
OSMOPY_DEBUG_TCP_SOCKETS is present and not "0".

Makes it easy to enable it on jenkins without blowing up output of normal runs
"at home".

Change-Id: I46212d07a2c1be05672a37766457e6c98b68f90d
2017-03-06 15:31:03 +01:00
Neels Hofmeyr f6ab3d8e9c osmoutil: open /dev/null only once
Change-Id: Ic6da34f6c4c5cd3b0786788f4e38c9c6248fca1b
2017-02-24 20:49:51 +01:00
Neels Hofmeyr b59b677c9b osmoutil: try to terminate process instead of killing
Change-Id: Iaa978467b140e3d6dc5a2a6d8966282e64630ce7
2017-02-24 20:49:39 +01:00
Neels Hofmeyr 8972d06754 osmotestconfig: fix socket leak
Each running test would open up another socket without ever closing unused
ones. Close the sockets after each test is done.

Change-Id: If97944a079e901439139161eae39181f5c800200
2017-02-24 20:49:34 +01:00
Neels Hofmeyr 3ef39e9b9e osmoutil: centrally log process launches
Log Popen in osmoutil.py instead of in each python test. Launch message is
being removed in openbsc's python tests and added here. (change-id
Id8eb70ddfdc1d0d9f90aa5343a4ea522042c34ee)

Change-Id: I7e539abc3aeee91ae3e7635f9e28b9e557eaf969
2017-02-24 20:49:27 +01:00
Neels Hofmeyr 93a808eaba debug: monitor used TCP sockets and running osmo processes
Add global flag debug_tcp_sockets; if true, monitors all open TCP sockets of
the system and running processes by regular 'ss' and 'ps' output, and logs
which VTY sockets are opened and closed.

Change-Id: I0cc7dc049c66f29fe58fee204e74aa9e82c21989
2017-02-24 20:49:21 +01:00
Holger Hans Peter Freyther 99b5c56c04 vty: Close the vty sockets at the end of each test
In the OpenBSC VTY tests it seems no one is calling
the command with close=True. So make sure the socket
is released. Modify _close_socket to be idempotent.

Change-Id: I717537772e89113ef352d32ffba1b7a840f2c6e6
2017-02-13 20:09:01 +07:00
Holger Hans Peter Freyther 0edf0c9995 vty: Check the result of the write command
When running on top of vboxsf the write option doesn't work and we
have a success that should be a failure. Check the success string
we want to see on write.

Change-Id: I460e2da10f049807e4729f53fc69448c9c30f5f9
2016-08-15 12:37:39 +02:00
Max 6c33a15e41 Fix build failure
After copytree the destination directory might end up not being writable
- this causes failure for subsequent writeconfig tests. Force rwx
permissions to fix it.
2016-04-14 08:32:06 -04:00
Max 334d680d28 Recursively copy files before config test
Copy all potentially necessary files (like includable configs) before
running config test.
2016-04-12 10:15:41 -04:00
Max 5f4567b2a2 Extend apps attribute
In addition to binary name it's now possible to provide extra
command-line arguments in osmoappdesc.py for application under
test. This change is fully optional and backward compatible.
2016-03-31 11:59:56 +02:00
Max d401cc13ae Add optional ignore_configs attribute
This attribute in osmoappdesc.py allows to ignore certain configs while
running vty tests. It's handy for hardware-specific or otherwise special
configuration examples.
2016-03-31 11:59:35 +02:00
Max 32d0fd8872 Expand installation instructions 2016-03-31 11:59:10 +02:00
Max 44f5163c50 Add .gitignore
Ignore install leftovers.
2016-03-31 11:59:09 +02:00
Alexander Chemeris 2f48313ed6 obscvty: Implement readlines() generator function. 2015-05-30 17:45:49 +02:00
Holger Hans Peter Freyther b819b57a98 testconfig: Do not fail due wrong numbers
Fix the script and don't fail
2015-01-31 21:15:06 +01:00
Holger Hans Peter Freyther 4e98c266b7 testconfig: Check the result of running the individual tests
Currently the tests might find issues with the documentation but
the exit code is still 0. This attemps to make the test_config
check the result of each test and then return if an error has
occurred. This should propagate all the way into a sys.exit()
call.
2014-07-04 20:43:38 +02:00
Jacob Erlbeck 41b0d30459 obscvty: Added node() method to get the last node string
Extract the node name from the VTY prompt after executing a
command and return it via the new VTYInteract.node() method.
2013-08-30 18:28:05 +02:00
Holger Hans Peter Freyther 99bbea7f19 obscvty: Make the _is_end detection work for entering the config
Make the code work for entering the configuration step. The name
of the configured node will show up. Change the semantic of the
_is_end method to return how many chars make up the end.
2013-06-25 08:20:41 +02:00
Kat cd564fcebc Fixed osmodumpdoc to work with the refactored importing 2013-04-06 11:11:49 +02:00
Kat 0270be43b9 Minor refactoring of importing osmoappdesc 2013-04-05 21:34:52 +02:00
Kat 0248d3b668 Made the scripts work from make distcheck 2013-04-05 20:20:50 +02:00
Kat 0d114c854b Added a verbosity option and banner to osmotestvty 2013-04-05 18:21:39 +02:00
Kat a8ee6bb97b Documentation: added a README, more docstrings; +x'd setup.py 2013-04-05 17:08:28 +02:00
Kat a7185c6c72 This is a set of test scripts for osmocom projects.
Currently, it's tested on openbsc and osmo-pcu.
Scripts: osmotestvty.py osmodumpdoc.py osmotestconfig.py
The scripts are designed to be run from make check,
but can be run independently as well.
As a general rule, run them in the top dir of a project.
2013-04-04 17:31:17 +02:00