Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opencog] ShellUTest test fails (nc: invalid option -- 'q') #28

Closed
Radivarig opened this issue May 2, 2019 · 8 comments
Closed

[opencog] ShellUTest test fails (nc: invalid option -- 'q') #28

Radivarig opened this issue May 2, 2019 · 8 comments

Comments

@Radivarig
Copy link
Collaborator

Radivarig commented May 2, 2019

12/30 Test #12: ShellUTest .......................***Failed  613.59 sec
Running cxxtest tests (5 tests)nc: invalid option -- 'q'
usage: nc [-46cDdFhklNnrStUuvz] [-C certfile] [-e name] [-H hash] [-I length]
	  [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]
	  [-o staplefile] [-P proxy_username] [-p source_port] [-R CAfile]
	  [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
	  [-X proxy_protocol] [-x proxy_address[:port]] [-Z peercertfile]
	  [destination] [port]
Listening on port 17333
Error: first call failed

I've tried with netcat-gnu 0.7.1 and netcat-openbsd 2.7.4 packages which seems to both not have the -q option.

@linas
Copy link
Member

linas commented May 3, 2019

I'm running netcat-openbsd and it won't print out it's own version number, but the changelog shows

netcat-openbsd (1.130-3) unstable; urgency=medium
 -- Guilhem Moulin <guilhem@guilhem.org>  Fri, 03 Mar 2017 20:32:55 +0100

The -w flag does something completely different. It's not the same timeout, its a different timeout.

One of the problems with nc is that they are not compatible with one-another, which seems like a big mistake for something that should have been easy :-/

@linas
Copy link
Member

linas commented May 3, 2019

here's what my manpage says about -q:


     -q seconds
             after EOF on stdin, wait the specified number of seconds and then
             quit. If seconds is negative, wait forever (default).  Specifying
             a non-negative seconds implies -N.

I forget the details right now, but some versions of netcat waited forever (even though the server had closed the socket) and other versions of netcat did not wait at all, and got no reply. Thus, for these various flavors of netcat, one has to fiddle with the unit test, so that netcat waits for a reply, but then hangs up when the remote end hangs up.

@Radivarig
Copy link
Collaborator Author

Found that netcat-openbsd version that I was using is aliased to a netcat version from libressl package which is missing this option as mentioned here. That PR replaced the direct debian netcat source which has the -q option.

I've build v1.130-3 that you have and get this output (also tried with v1.187-1 and v1.190-1):

test 12
      Start 12: ShellUTest

12: Test command: /home/radivarig/tmpdev/netcat/source/build/tests/server/ShellUTest
12: Test timeout computed to be: 10000000
12: Running cxxtest tests (5 tests)opencog> command "scm" not found
12: opencog> command "(Concept" not found
12: opencog> opencog> opencog> command "scm" not found
12: opencog> command "scm" not found
12: opencog> command "(+" not found
12: opencog> command "�" not found
12: opencog> opencog> opencog> command "scm" not found
12: opencog> command "scm" not found
12: opencog> command "(Concept" not found
12: opencog> opencog> opencog> command "scm" not found
12: opencog> command "(+" not found
12: opencog> command "." not found
12: opencog> opencog> Listening on port 17333
12: .opencog> command "scm" not found
12: opencog> command "(sleep" not found
12: opencog> command "�" not found
12: opencog> opencog> command "scm" not found
12: opencog> command "(sleep" not found
12: opencog> command "�" not found
12: opencog> opencog> command "scm" not found
12: opencog> command "(sleep" not found
12: opencog> command "�" not found
12: opencog> Listening on port 17333
12: Elapsed: 0
12: First elapsed: 0
12: Second elapsed: 0
12: .Listening on port 17333
12: Received 145 bytes: opencog> command "scm" not found
12: opencog> command "(cog-prt-atomspace)" not found
12: opencog> 
12: 
12: In ShellUTest::testDrain:
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:311: Error: Expected (200 < ply.size()), found (200 >= 145)
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:314: Error: Assertion failed: ply.npos != ply.find("(ConceptNode \"A\")")
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:315: Error: Assertion failed: ply.npos != ply.find("(ConceptNode \"B\")")
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:316: Error: Assertion failed: ply.npos != ply.find("(ConceptNode \"C\")")
12: Listening on port 17333
12: In ShellUTest::testMessaging:
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:76: Error: Expected (281 <= reso.size()), found (281 > 164)
12: Error: Create rep 0 of 30 in thread 2 failed
12: 	Got: 164 >>>opencog> command "scm" not found
12: opencog> command "(Evaluation" not found
12: opencog> opencog> <<<
12: /home/radivarig/tmpdev/netcat/source/build/tests/server/../../../tests/server/ShellUTest.cxxtest:76: Error: Expected (281 <= reso.size()), found (281 > 164)
12: Error: Create rep 0 of 30 in thread 0 failed
12: 	Got: 164 >>>opencog> command "scm" not found
12: opencog> command "(Evaluation" not found
12: opencog> opencog> <<<
...

@linas
Copy link
Member

linas commented May 9, 2019

This message: opencog> opencog> opencog> command "scm" not found implies that cogserver was built without guile ... or more likely, the guile module is not being found.

The cogserver defines it's own module system of loadable modules. there's a bunch, most are quite trivial, the source code is here: /opencog/cogserver .. anything with Module in the name. By default, the modules that are loaded are specified in the opencog.conf file, and/or the cogserver.conf file. (We should change the default to just load them, no matter what) my guess is

-- nix is not finding cogserver.conf
-- it is finding the conf file, but not the *.so's that need to be loaded.

@linas
Copy link
Member

linas commented May 9, 2019

The modules go here: "lib${LIB_DIR_SUFFIX}/opencog/modules"

@linas
Copy link
Member

linas commented May 9, 2019

The *.conf files are not needed; seems that suitable defaults are used. So the problem is that the opencog/modules/libscheme-shell.so is not being found by the cogserver.

@Radivarig
Copy link
Collaborator Author

You're right! I've found //logger().set_print_to_stdout_flag(true); and uncommented, and I see now that there is a warning for modules not loading:

12: [2019-05-11 19:49:30:601] [WARN] No configuration file was loaded! Param=MODULES
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libbuiltinreqs.so
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libscheme-shell.so
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libpy-shell.so
log

test 12
      Start 12: ShellUTest

12: Test command: /home/radivarig/tmpdev/opencog/source/build/tests/server/ShellUTest
12: Test timeout computed to be: 10000000
12: Running cxxtest tests (2 tests)[2019-05-11 19:49:30:532] [DEBUG] [SystemActivityTable] constructor
12: [2019-05-11 19:49:30:571] [INFO] [global_python_initialize] Start
12: [2019-05-11 19:49:30:600] [INFO] [global_python_initialize] Adding OpenCog sys.path directories
12: [2019-05-11 19:49:30:600] [DEBUG] Python 'sys.path' is:
12: [2019-05-11 19:49:30:600] [DEBUG]      0 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]      1 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]      2 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]      3 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]      4 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages/linkgrammar
12: [2019-05-11 19:49:30:600] [DEBUG]      5 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages/setuptools-40.2.0-py3.6.egg
12: [2019-05-11 19:49:30:600] [DEBUG]      6 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python36.zip
12: [2019-05-11 19:49:30:600] [DEBUG]      7 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6
12: [2019-05-11 19:49:30:600] [DEBUG]      8 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/lib-dynload
12: [2019-05-11 19:49:30:600] [DEBUG]      9 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     10 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     11 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     12 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     13 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     14 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     15 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     16 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     17 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     18 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     19 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     20 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     21 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     22 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     23 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     24 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     25 > /nix/store/kqxg3pl9d7n2fqz2d5kdzdhngrxrbpx8-link-grammar/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     26 > /nix/store/80qva2zal82njkg4zvb7xg94mnikqksd-python3-3.6.8/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     27 > /nix/store/0vq2dxkw23r9m79syjg2f0cp7n8x1hbg-python3.6-Cython-0.28.3/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:600] [DEBUG]     28 > /nix/store/d5q5q904wmbz0lxy95fvjsqkcbdi56kf-python3.6-setuptools-40.2.0/lib/python3.6/site-packages
12: [2019-05-11 19:49:30:601] [WARN] PythonEval::try_to_load_modules Failed to load the opencog.atomspace module
12: [2019-05-11 19:49:30:601] [INFO] [global_python_initialize] Finish
12: [2019-05-11 19:49:30:601] [WARN] PythonEval::atomspace_py_object Failed to load theopencog.atomspace module
12: [2019-05-11 19:49:30:601] [INFO] PythonEval::initialize_python_objects_and_imports Finished initialising python evaluator.
12: [2019-05-11 19:49:30:601] [DEBUG] [SystemActivityTable] init
12: [2019-05-11 19:49:30:601] [WARN] No configuration file was loaded! Param=MODULES
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libbuiltinreqs.so
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libscheme-shell.so
12: [2019-05-11 19:49:30:601] [WARN] Failed to load cogserver module libpy-shell.so
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ./opencog/cogserver/server/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ./opencog/cogserver/shell/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ./
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at .//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at .//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ..//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ..//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../..//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../..//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../../
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../..//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../..//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../../../
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../../..//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at ../../../..//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/lib
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/lib/opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/lib/opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/share
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/share/opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at "/nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil"/share/opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil/share/opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil/share/opencog/opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /nix/store/rz732p2rnvhs3278vfvy6fsm7irpmz8a-cogutil/share/opencog/opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib64/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib64//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib64//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/lib//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/share/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/share//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/local/share//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib64/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib64//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib64//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/lib//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/share/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/share//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /usr/share//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /opt/
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /opt//opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /opt//opencog/modules
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at /
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at //opencog
12: [2019-05-11 19:49:30:601] [WARN] Searched for module at //opencog/modules
12: [2019-05-11 19:49:30:601] [INFO] Loading module "libscheme-shell.so"
12: [2019-05-11 19:49:30:601] [WARN] Unable to load module "libscheme-shell.so": libscheme-shell.so: cannot open shared object file: No such file or directory
12: [2019-05-11 19:49:30:601] [WARN] No configuration file was loaded! Param=SERVER_PORT
12: [2019-05-11 19:49:30:602] [DEBUG] [NetworkServer] constructor
12: Listening on port 17333

@Radivarig
Copy link
Collaborator Author

Radivarig commented May 11, 2019

Since the -q option is resolved by a custom netcat package and the above problem is resolved with:
csrv->loadModules({"../../opencog/cogserver/server/", "../../opencog/cogserver/shell/"}); moving to a separate issue #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants