Giter Site home page Giter Site logo

lux's People

Contributors

hawk avatar johanvikman avatar js2702 avatar plux avatar sudnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lux's Issues

incorrect match behaviour after loop

I have the following lux script:

[shell topdc]
    # <stuff>
    [loop wait 1..30]
        # set a loop break pattern
        @oper-status: scheduled
        !$supctl -d .topdc show state application-deployments health-infra
        ?SH-PROMPT
        [sleep 1]
    [endloop]
    """?
      applications:
        - name: health
          datacenters:
            - udc1
    SH-PROMPT:
    """

This sometimes fails (most of the time it works!) with:

    applications:
      - name: health
        datacenters:
          - udc1
- SH-PROMPT:
+ SH-PROMPT

I.e., lux thinks that it doesn't get the last ":". But the ":" is there in the stdout log from the "topdc" shell.

Here's some more interesting logs:

00:09:59.150605 topdc(184): recv "name: health-infra\napplications:\n  - name: health\n    placement:\n      match-dc-labels: |\n        dm-env/type = edge and dm-env/name = udc1\nstatus:\n  oper-status: scheduled\n  applications:\n    - name: health\n      datacenters:\n        - udc1\nSH-PROMPT:"
00:09:59.150720 topdc(184): timer canceled (after 112286 micro seconds)
00:09:59.150842 topdc(184): skip ":../../../../../bin/supctl -d .topdc show state application-deployments health-infra\nname: health-infra\napplications:\n  - name: health\n    placement:\n      match-dc-labels: |\n        dm-env/type = edge and dm-env/name = udc1\nstatus:\n  "
00:09:59.150916 topdc(184): match loop break pattern matched "oper-status: scheduled"
00:09:59.151856 topdc(193): expected* "  applications:\\R    - name: health\\R      datacenters:\\R        - udc1\\RSH-PROMPT:"
00:09:59.151903 topdc(193): timer started (10 seconds * 2.000 multiplier)

So here lux has successfully matched the loop break pattern, and is now waiting for the next pattern. Note that it has received the expected output already at 00:09:59.150605.

Next, in the log we have:

00:10:19.152328 topdc(193): recv "match_timeout"
00:10:19.152799 topdc(193): timer failed (after 20000840 micro seconds)
00:10:19.152984 topdc(193): skip "\n  applications:\n    - name: health\n      datacenters:\n        - udc1\nSH-PROMPT"
00:10:19.153090 topdc(193): stop fail
00:10:19.153177 topdc(193): where "193"
00:10:19.153225 topdc(193): stack "run.lux:193" expect 
00:10:19.153268 topdc(193): inactivate after delete

And in the stdout text log we have:

SH-PROMPT:../../../../../bin/supctl -d .topdc show state application-deployments health-infra
name: health-infra
applications:
  - name: health
    placement:
      match-dc-labels: |
        dm-env/type = edge and dm-env/name = udc1
status:
  oper-status: scheduled
  applications:
    - name: health
      datacenters:
        - udc1
SH-PROMPT:

crash with --require

Command-line options like --require cause lux to crash:

#lux --require CONFIG_DIR test.lux 
summary log       : /base/lux_logs/run_2015_08_13_14_43_08/lux_summary.log


FATAL ERROR: /base/lux_logs/run_2015_08_13_14_43_08/lux_summary.log:
    error:function_clause [{lists,reverse,"R",[{file,"lists.erl"},{line,146}]},
                       {string,tokens,2,[{file,"string.erl"},{line,232}]},
                       {lux_suite,'-merge_env_opt/2-lc$^0/1-0-',1,
                                  [{file,"lux_suite.erl"},{line,891}]},
                       {lux_suite,merge_env_opt,2,
                                  [{file,"lux_suite.erl"},{line,891}]},
                       {lux_suite,merge_opts,3,
                                  [{file,"lux_suite.erl"},{line,866}]},
                       {lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
                       {lux_suite,parse_script,3,
                                  [{file,"lux_suite.erl"},{line,627}]},
                       {lux_suite,run_cases,5,
                                  [{file,"lux_suite.erl"},{line,424}]}]

After the commit 7e8e9a command line option arguments are no longer grouped, but merge_env_opt obviously expects that they are.

Lux terminates before completing all commands

Hello, I have the following script I am running:

13[shell func-027]
14  [progress 'Function-27 Start']
15
16  # Create service order, check dry-run output, commit
17  [progress 'Dry-Run']
18  [invoke func027_033_068_074_rest $DEVICE0 $TENGIGE $FUNC027 $DRY_RUN ${LOGDRY}-CREATE.tmp]
19  !bash compare.sh ../expected/native/FUNC-027 ${LOGDRY}-CREATE.tmp
20  ?Partial True
21  [progress 'Commit']
22  [invoke func027_033_068_074_rest $DEVICE0 $TENGIGE $FUNC027 $COMMIT ${LOGCOMMIT}-CREATE.tmp]
23  !grep '201 Created' ${LOGCOMMIT}-CREATE.tmp
24  ?HTTP/1.1 201 Created
25
26  # Delete the service order
27  [progress 'FUNC-027 Delete']
28  [invoke delete_service_order_dryrun_rest $COMMIT $SERVICE $FUNC027 ${LOGDRY}-DELETE.tmp]
29  !if grep --quiet "error" ${LOGDRY}-DELETE.tmp; then echo 'Dry-run failed. Exiting'; exit 1; fi
30  [invoke delete_service_order_rest $COMMIT $SERVICE $FUNC027 ${LOGCOMMIT}-DELETE.tmp]
31  !if grep --quiet "error" ${LOGCOMMIT}-DELETE.tmp; then echo 'Dry-run failed. Exiting'; exit 1; fi
32  #?bubba
33
34[cleanup]
35  [progress 'Cleanup']
36  [invoke delete_service_order_rest $COMMIT $SERVICE $FUNC027 ${LOGCOMMIT}-CLEANUP.tmp]

Lines 28 and 30 call macros which essentially just run a cURL command and redirect the output into a file. However, these macros consistently do not finish executing because Lux exits immediately after successfully sending the command. One of the macros is attached below.

313##
314# Delete a service order, dryrun, through REST API/cURL command, pipe into file
315#  @param SERVICE - Service name
316#  @param ORDER - Order name
317#
318[macro delete_service_order_rest url service order file]
319    !curl -is -X DELETE -u admin:admin $url/$service/$order >> $file
320[endmacro]

I have come to this conclusion by artificially adding an expects line and letting the script time out and fail (see line 32 above, currently commented out). When the script times out, all of the expected files are printed to properly, but when the expect line is commented out, the script finishes very quickly and the shell terminates before all output is piped to the files.

Is there a way around this? I already tried sleep 5 but that didn't work, script still finished instantly. Thanks for your time!

Large multi-line regular expressions do not match

This seems to be a similar issue to #17, but on the expect side rather than the send side.

I am cat-ing a file multiple times to search for several different blocks of text. (I cannot use a file compare utility such as diff because the text blocks may appear in any order.)

Script 3 passes:

!cat test.txt
"""??
<48 bytes (5 lines)>
"""
!cat test.txt
"""??
<48 bytes (5 lines)>
"""
!cat test.txt
"""??
<4057 bytes (113 lines)>
"""
!cat test.txt
"""??
<4057 bytes (113 lines)>
"""

while script 4 fails:

!cat test.txt
"""??
<Block 1: 48 bytes (5 lines)>
"""
!cat test.txt
"""??
<Block 2: 48 bytes (5 lines)>
"""
!cat test.txt
"""??
<Block 3: 3875 bytes (108 lines)>
"""
!cat test.txt
"""??
<Block 4: 3875 bytes (108 lines)>
"""

with the following output:

result            : FAIL at 40:21:-1:22:121:1834
expected
	<Block 3: 3875 bytes (108 lines)>
actual match_timeout

	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:cat test.txt
	cat test.txt
	<Block 1: 48 bytes (5 lines)>
	<Block 2: 48 bytes (5 lines)>
	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:cat test.txt
	<Block 1: 48 bytes (5 lines)>
	<Block 2: 48 bytes (5 lines)>
	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:

successful        : 0
failed            : 1
script_04.lux:40:21:-1:22:121:1834 - match_timeout
summary           : FAIL

There is no particular length that causes it to fail; from the examples we see that an expect of 4057 bytes succeeds but an expect of 3875 bytes fails. However this problem does only manifest on expects that are qualitatively "long."

I am using the latest Lux from the non-blocking-pty branch.

Steps to install LUX in MAC-OS

Hi Team,

Can anyone help me install LUX in mac os. Tried everything from the portal here but no help.

It would be great if someone can guide me through to install and run LUX on my mac-os.

Install lux failed

[root@ucs-sdn-7 lux]# make install
make[1]: Entering directory `/nobackup/haofan/nso/lux/src'
mkdir -p /nobackup/haofan/nso/luxinstall
/nobackup/haofan/nso/lux/bin/lux --install /nobackup/haofan/nso/luxinstall
Installing lux as a standalone system... /nobackup/haofan/nso/luxinstall

FATAL ERROR : The application 'erts' is required for the "--install" option.
ESCRIPT : /nobackup/haofan/nso/lux/bin/lux
VERSION : 1.14.2
CWD : /nobackup/haofan/nso/lux/src
ROOT DIR : /usr/lib64/erlang
CODE PATH : ["/nobackup/haofan/nso/lux/ebin",".",
"/usr/lib64/erlang/lib/kernel-2.14.5/ebin",
"/usr/lib64/erlang/lib/stdlib-1.17.5/ebin",
"/usr/lib64/erlang/lib/xmerl-1.2.10/ebin",
"/usr/lib64/erlang/lib/wx-0.99/ebin",
"/usr/lib64/erlang/lib/webtool-0.8.9/ebin",
"/usr/lib64/erlang/lib/typer-0.9.2/ebin",
"/usr/lib64/erlang/lib/tv-2.1.4.7/ebin",
"/usr/lib64/erlang/lib/tools-2.6.6.5/ebin",
"/usr/lib64/erlang/lib/toolbar-1.4.2/ebin",
"/usr/lib64/erlang/lib/test_server-3.4.5/ebin",
"/usr/lib64/erlang/lib/syntax_tools-1.6.7.1/ebin",
"/usr/lib64/erlang/lib/ssl-4.1.6/ebin",
"/usr/lib64/erlang/lib/ssh-2.0.8/ebin",
"/usr/lib64/erlang/lib/snmp-4.21.1/ebin",
"/usr/lib64/erlang/lib/sasl-2.1.10/ebin",
"/usr/lib64/erlang/lib/runtime_tools-1.8.6/ebin",
"/usr/lib64/erlang/lib/reltool-0.5.7/ebin",
"/usr/lib64/erlang/lib/public_key-0.13/ebin",
"/usr/lib64/erlang/lib/pman-2.7.1/ebin",
"/usr/lib64/erlang/lib/percept-0.8.6/ebin",
"/usr/lib64/erlang/lib/parsetools-2.0.6/ebin",
"/usr/lib64/erlang/lib/otp_mibs-1.0.6/ebin",
"/usr/lib64/erlang/lib/os_mon-2.2.7/ebin",
"/usr/lib64/erlang/lib/orber-3.6.22/ebin",
"/usr/lib64/erlang/lib/odbc-2.10.11/ebin",
"/usr/lib64/erlang/lib/observer-0.9.10/ebin",
"/usr/lib64/erlang/lib/mnesia-4.5/ebin",
"/usr/lib64/erlang/lib/megaco-3.15.1.1/ebin",
"/usr/lib64/erlang/lib/jinterface-1.5.4",
"/usr/lib64/erlang/lib/inviso-0.6.2/ebin",
"/usr/lib64/erlang/lib/inets-5.7.1/ebin",
"/usr/lib64/erlang/lib/ic-4.2.27/ebin",
"/usr/lib64/erlang/lib/hipe-3.8.1/ebin",
"/usr/lib64/erlang/lib/gs-1.5.14/ebin",
"/usr/lib64/erlang/lib/eunit-2.2.1/ebin",
"/usr/lib64/erlang/lib/et-1.4.4/ebin",
"/usr/lib64/erlang/lib/erts-5.8.5/ebin",
"/usr/lib64/erlang/lib/erl_interface-3.7.5",
"/usr/lib64/erlang/lib/erl_docgen-0.2.6/ebin",
"/usr/lib64/erlang/lib/edoc-0.7.9/ebin",
"/usr/lib64/erlang/lib/docbuilder-0.9.8.11/ebin",
"/usr/lib64/erlang/lib/diameter-0.10/ebin",
"/usr/lib64/erlang/lib/dialyzer-2.4.4/ebin",
"/usr/lib64/erlang/lib/debugger-3.2.6/ebin",
"/usr/lib64/erlang/lib/crypto-2.0.4/ebin",
"/usr/lib64/erlang/lib/cosTransactions-1.2.11/ebin",
"/usr/lib64/erlang/lib/cosTime-1.1.11/ebin",
"/usr/lib64/erlang/lib/cosProperty-1.1.14/ebin",
"/usr/lib64/erlang/lib/cosNotification-1.1.17/ebin",
"/usr/lib64/erlang/lib/cosFileTransfer-1.1.12/ebin",
"/usr/lib64/erlang/lib/cosEventDomain-1.1.11/ebin",
"/usr/lib64/erlang/lib/cosEvent-2.1.11/ebin",
"/usr/lib64/erlang/lib/compiler-4.7.5/ebin",
"/usr/lib64/erlang/lib/common_test-1.5.5/ebin",
"/usr/lib64/erlang/lib/asn1-1.6.18/ebin",
"/usr/lib64/erlang/lib/appmon-2.1.13/ebin"]
make[1]: *** [install] Error 4
make[1]: Leaving directory /nobackup/haofan/nso/lux/src' make[1]: Entering directory/nobackup/haofan/nso/lux/c_src'
make[1]: Nothing to be done for install'. make[1]: Leaving directory/nobackup/haofan/nso/lux/c_src'
[root@ucs-sdn-7 lux]#
[root@ucs-sdn-7 lux]# make --install
make: unrecognized option '--install'
Usage: make [options] [target] ...
Options:

Archlinux: The application 'lux' is missing.

Hi. I have installed lux using method in INSTALL.md for Arch Linux, tried building using "autoconf/.configure/make/make install" but I am still getting following error when I try to run lux:

FATAL ERROR : The application 'lux' is missing.
ESCRIPT : /usr/bin/lux
VERSION : nofile
CWD : /home/mpapco/Projects/ngena/src
APP DIR : /usr/lib/lux
ROOT DIR : /usr/lib/erlang
CODE PATH : ["/usr/lib/lux/ebin",".",
"/usr/lib/erlang/lib/kernel-8.5.1/ebin",
"/usr/lib/erlang/lib/stdlib-4.1.1/ebin",
"/usr/lib/erlang/lib/xmerl-1.3.30/ebin",
"/usr/lib/erlang/lib/wx-2.2/ebin",
"/usr/lib/erlang/lib/tools-3.5.3/ebin",
"/usr/lib/erlang/lib/tftp-1.0.3/ebin",
"/usr/lib/erlang/lib/syntax_tools-3.0/ebin",
"/usr/lib/erlang/lib/ssl-10.8.5/ebin",
"/usr/lib/erlang/lib/ssh-4.15/ebin",
"/usr/lib/erlang/lib/snmp-5.13.1/ebin",
"/usr/lib/erlang/lib/sasl-4.2/ebin",
"/usr/lib/erlang/lib/runtime_tools-1.19/ebin",
"/usr/lib/erlang/lib/reltool-0.9/ebin",
"/usr/lib/erlang/lib/public_key-1.13.1/ebin",
"/usr/lib/erlang/lib/parsetools-2.4.1/ebin",
"/usr/lib/erlang/lib/os_mon-2.7.1/ebin",
"/usr/lib/erlang/lib/observer-2.13/ebin",
"/usr/lib/erlang/lib/mnesia-4.21.2/ebin",
"/usr/lib/erlang/lib/megaco-4.4.1/ebin",
"/usr/lib/erlang/lib/jinterface-1.13.1/ebin",
"/usr/lib/erlang/lib/inets-8.1/ebin",
"/usr/lib/erlang/lib/ftp-1.1.1/ebin",
"/usr/lib/erlang/lib/eunit-2.8.1/ebin",
"/usr/lib/erlang/lib/et-1.6.5/ebin",
"/usr/lib/erlang/lib/erts-13.1.2/ebin",
"/usr/lib/erlang/lib/erl_interface-5.3/ebin",
"/usr/lib/erlang/lib/erl_docgen-1.4/ebin",
"/usr/lib/erlang/lib/eldap-1.2.10/ebin",
"/usr/lib/erlang/lib/edoc-1.2/ebin",
"/usr/lib/erlang/lib/diameter-2.2.7/ebin",
"/usr/lib/erlang/lib/dialyzer-5.0.3/ebin",
"/usr/lib/erlang/lib/debugger-5.3/ebin",
"/usr/lib/erlang/lib/crypto-5.1.2/ebin",
"/usr/lib/erlang/lib/compiler-8.2.1/ebin",
"/usr/lib/erlang/lib/common_test-1.23.1/ebin",
"/usr/lib/erlang/lib/asn1-5.0.21/ebin"]

I am using archlinux(6.0.7-arch1-1) with installed erlang 25.1.2-2 package (I have tried erlang-nox 25.1.2-1, but getting same error).

Error seems to be raised in main method of lux on line
LuxAppDir = require_app(undefined, ?APPLICATION),
then require_app method

   AppDir ->
        case application:load(AppName) of
            ok ->
                AppDir;
            {error, {already_loaded,AppName}}->
                AppDir;
            {error, _} ->	    
  	    io:format("...PAPO in require_app _ AppDir:~s", [AppDir]),
                missing_app(MainOp, AppName)
        end

I have checked issue #19 that looks similar, but setting "export ERL_LIBS=/usr/local/lux/lib" didn't really help.
Is there any further step necessary for Linux/ArchLinux?

make: runpty.c

gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c
runpty.c: In function ‘main’:
runpty.c:98:11: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result]
setuid(getuid());
^

Where is match_timeout documented?

In version 1.15.1, there is a failure that may occur that is called match_timeout. An example of this can be seen in test/examples.delux (current version). However, there is no documentation on what this timeout means or how it is used. See doc/lux.md (current version). Trying to use it like the other timeouts, e.g. lux --match_timeout infinity testcase.lux gives the error: lux.escript: "--match_timeout" is an illegal argument. By contrast, lux --case_timeout infinity testcase.lux runs just fine.

What is a match_timeout and can you please add some documentation for it? Thanks.

lux_html_parse.erl:13: can't find include lib "xmerl/include/xmerl.hrl" and FATAL ERROR : The application 'lux' is missing.

odl@ubuntu:/nso/lux$ make
make[1]: Entering directory /home/odl/nso/lux/src' "/home/odl/nso/4.1.1/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux.erl "/home/odl/nso/4.1.1/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_debug.erl "/home/odl/nso/4.1.1/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_gen.erl "/home/odl/nso/4.1.1/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_parse.erl lux_html_parse.erl:13: can't find include lib "xmerl/include/xmerl.hrl" lux_html_parse.erl:186: record xmlElement undefined lux_html_parse.erl:189: variable 'Tag' is unbound lux_html_parse.erl:190: variable 'Attrs' is unbound lux_html_parse.erl:191: variable 'Content' is unbound lux_html_parse.erl:192: record xmlAttribute undefined lux_html_parse.erl:194: variable 'Tag' is unbound lux_html_parse.erl:194: variable 'Value' is unbound lux_html_parse.erl:195: record xmlText undefined lux_html_parse.erl:196: variable 'Text' is unbound lux_html_parse.erl:200: record xmlComment undefined make[1]: *** [../ebin/lux_html_parse.beam] Error 1 make[1]: Leaving directory/home/odl/nso/lux/src'
make[1]: Entering directory /home/odl/nso/lux/c_src' gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c make[1]: Leaving directory/home/odl/nso/lux/c_src'
odl@ubuntu:
/nso/lux$ make install
make[1]: Entering directory `/home/odl/nso/lux/src'
mkdir -p /home/odl/nso/luxinstall
/home/odl/nso/lux/bin/lux --install /home/odl/nso/luxinstall

FATAL ERROR : The application 'lux' is missing.
ESCRIPT : /home/odl/nso/lux/bin/lux
VERSION : unknown
CWD : /home/odl/nso/lux/src
ROOT DIR : /usr/lib/erlang
CODE PATH : ["/home/odl/nso/lux/ebin",".",
"/usr/lib/erlang/lib/kernel-2.16.4/ebin",
"/usr/lib/erlang/lib/stdlib-1.19.4/ebin"

Setting priority on Lux documents.

We often start our Lux test like this $ lux *.lux, one problem with this is that sometimes certain lux files need to be executed before others. We solve this with a naming standard but it´s a bit cumbersome. Would it be possible to add priority to a Lux document?

[doc Run this test first]
[priority 1]
...
[doc Basic test]
[priority 2]
...
[doc Standard test]
[priority 2]
...

compilation problem warn_unused_result [-Wunused-result]

Hello,
I've got the following error when trying to build:

$ autoconf
$ ./configure
...
$ make
make[1]: Entering directory '/home/bial/src/lux/src'
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_debug.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_interpret.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_log.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_suite.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_tap.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_parse.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_shell.erl
"/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_utils.erl
sed -e "s/%VSN%/1.8.6/g" < lux.app.src > ../ebin/lux.app
make[1]: Leaving directory '/home/bial/src/lux/src'
make[1]: Entering directory '/home/bial/src/lux/c_src'
gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c
runpty.c: In function ‘main’:
runpty.c:98:5: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result]
setuid(getuid());
^
make[1]: Leaving directory '/home/bial/src/lux/c_src'

I workarounded it by adding '-Wno-unused-result' to CFLAGS in include.mk file at line 29 before invoking 'make'.

My system is Ubuntu 15.04 with the following build tools:
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
autoconf 2.69
GNU Make 4.0

Regular expression is too large error with ?+

I was trying out the ?+ syntax but found it quickly builds too large regexes. I got Syntax error: regular expression is too large with the following:

    ?+"computeNodeAssignmentChange"
    ?+"callerRequestId":"6"
    ?+"eventTime"
    ?+"result":"ng"
    ?+"errno":"deregistrationFail"
    ?"additionalInfo":"License deregistration failed for vCPE ebuilding1aive901100, ebuilding1aive901200"

I think this could be implemented more efficiently in code than building a gigantic regex, it is very useful in some cases. In this case, I wanted to test Json output where the order of elements is implementation specific.

make error

I just cloned lux and there is an error in make

make
"/usr/local/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux.erl
"/usr/local/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_debug.erl
"/usr/local/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html.erl
compile: warnings being treated as errors
lux_html.erl:761: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
make[1]: *** [../ebin/lux_html.beam] Error 1
gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c
DBLAIR-M-2027:lux danablair$ pwd
/Users/danablair/lux

Invoke error in cleanup is not found

In this small example the cleanup section is supposed to invoke a macro.

However there's a syntax error in the macro invocation, the ending "]" is missing, so I expected a syntax error, however it is not found.

 lux --version
2.8.1
❯ cat test.lux
[doc]
Issue with the [cleanup] section.
[enddoc]

[shell test]
    !echo "test"
    ?test

[cleanup]
    [invoke missing_end_bracket%
❯ lux test.lux
summary log       : /Users/jvikman/dev/tailf/tmp/lux_logs/run_2023_08_21_05_10_30_562064/lux_summary.log

test case         : test.lux
progress          : ..:..:.:..:..:.:..c....:..:.:..:.
result            : SUCCESS

successful        : 1
summary           : SUCCESS

file:///Users/jvikman/dev/tailf/tmp/lux_logs/run_2023_08_21_05_10_30_562064/lux_summary.log.html

The application 'lux' is missing error when installing on MacOS

I am trying to follow the install process for ‘Obscure platforms’ as per attached install instructions.

Obscure platforms

On "obscure platforms" which have Erlang/OTP but lacks
autotools, make etc. it is still possible to build with

bin/lux --make

for example on OS X 10.11.6:

JOHOWEN-M-73DD:lux-master johowen$ bin/lux --make

FATAL ERROR : The application 'lux' is missing.
ESCRIPT : bin/lux
VERSION : unknown
CWD : /Users/johowen/lux-master
ROOT DIR : /usr/local/lib/erlang
CODE PATH : ["/Users/johowen/lux-master/ebin",".",
"/usr/local/lib/erlang/lib/kernel-5.1.1/ebin",
"/usr/local/lib/erlang/lib/stdlib-3.2/ebin",
"/usr/local/lib/erlang/lib/xmerl-1.3.12/ebin",
"/usr/local/lib/erlang/lib/wx-1.8/ebin",
"/usr/local/lib/erlang/lib/typer-0.9.11/ebin",
"/usr/local/lib/erlang/lib/tools-2.9/ebin",
"/usr/local/lib/erlang/lib/syntax_tools-2.1.1/ebin",
"/usr/local/lib/erlang/lib/ssl-8.1/ebin",
"/usr/local/lib/erlang/lib/ssh-4.4/ebin",
"/usr/local/lib/erlang/lib/snmp-5.2.4/ebin",
"/usr/local/lib/erlang/lib/sasl-3.0.2/ebin",
"/usr/local/lib/erlang/lib/runtime_tools-1.11/ebin",
"/usr/local/lib/erlang/lib/reltool-0.7.2/ebin",
"/usr/local/lib/erlang/lib/public_key-1.3/ebin",
"/usr/local/lib/erlang/lib/percept-0.9/ebin",
"/usr/local/lib/erlang/lib/parsetools-2.1.4/ebin",
"/usr/local/lib/erlang/lib/otp_mibs-1.1.1/ebin",
"/usr/local/lib/erlang/lib/os_mon-2.4.1/ebin",
"/usr/local/lib/erlang/lib/orber-3.8.2/ebin",
"/usr/local/lib/erlang/lib/odbc-2.12/ebin",
"/usr/local/lib/erlang/lib/observer-2.3/ebin",
"/usr/local/lib/erlang/lib/mnesia-4.14.2/ebin",
"/usr/local/lib/erlang/lib/megaco-3.18.1/ebin",
"/usr/local/lib/erlang/lib/jinterface-1.7.1/ebin",
"/usr/local/lib/erlang/lib/inets-6.3.4/ebin",
"/usr/local/lib/erlang/lib/ic-4.4.2/ebin",
"/usr/local/lib/erlang/lib/hipe-3.15.3/ebin",
"/usr/local/lib/erlang/lib/gs-1.6.2/ebin",
"/usr/local/lib/erlang/lib/eunit-2.3.2/ebin",
"/usr/local/lib/erlang/lib/et-1.6/ebin",
"/usr/local/lib/erlang/lib/erts-8.2/ebin",
"/usr/local/lib/erlang/lib/erl_interface-3.9.2/ebin",
"/usr/local/lib/erlang/lib/erl_docgen-0.6.1/ebin",
"/usr/local/lib/erlang/lib/eldap-1.2.2/ebin",
"/usr/local/lib/erlang/lib/edoc-0.8.1/ebin",
"/usr/local/lib/erlang/lib/diameter-1.12.1/ebin",
"/usr/local/lib/erlang/lib/dialyzer-3.0.3/ebin",
"/usr/local/lib/erlang/lib/debugger-4.2.1/ebin",
"/usr/local/lib/erlang/lib/crypto-3.7.2/ebin",
"/usr/local/lib/erlang/lib/cosTransactions-1.3.2/ebin",
"/usr/local/lib/erlang/lib/cosTime-1.2.2/ebin",
"/usr/local/lib/erlang/lib/cosProperty-1.2.1/ebin",
"/usr/local/lib/erlang/lib/cosNotification-1.2.2/ebin",
"/usr/local/lib/erlang/lib/cosFileTransfer-1.2.1/ebin",
"/usr/local/lib/erlang/lib/cosEventDomain-1.2.1/ebin",
"/usr/local/lib/erlang/lib/cosEvent-2.2.1/ebin",
"/usr/local/lib/erlang/lib/compiler-7.0.3/ebin",
"/usr/local/lib/erlang/lib/common_test-1.13/ebin",
"/usr/local/lib/erlang/lib/asn1-4.0.4/ebin"]
JOHOWEN-M-73DD:lux-master johowen$

Error while running make install

Hi,
I am trying to install lux on ubuntu 14.04 desktop. Following are the steps that i have followed

  1. Installed erlang OTP

    http://erlang.org/download/otp_src_20.1.tar.gz

  2. Untar the folder and run configure

./configure

  1. Run make

make

  1. Run make install

sudo make install

After this otp is installed properly and my erlang run time is working

After this i clone the current lux repo and execute the following commands

  1. autoconf
  2. ./configure
  3. make
  4. sudo make install

The make install command is giving the following error
sachin@dev-ob:~/lux$ sudo make install
make[1]: Entering directory /home/sachin/lux/src' mkdir -p /usr/local/lux /home/sachin/lux/bin/lux --install /usr/local/lux Installing lux as a standalone system... /usr/local/lux ERROR: Module erl2html2 potentially included by two different applications: common_test and test_server. make[1]: *** [install] Error 1 make[1]: Leaving directory /home/sachin/lux/src'
make[1]: Entering directory /home/sachin/lux/c_src' make[1]: Nothing to be done for install'.
make[1]: Leaving directory `/home/sachin/lux/c_src'

Is there any problem with the steps i am following, or the code is broken. I am using the master branch to install lux

How to read content from a .txt file

Hi @hawk !

I'm new to Lux, but I have been "playing" with it for a while. Now I have a doubt about how to read some files (e.g. a .txt file) and "expect" some content. What I am doing at the moment is:

.lux file:

[doc prueba 4]

[global config4=$config4]
[global golden4=$golden4]

[shell uno]
    !echo ${config4}
    ?${golden4}

[cleanup]

And when I execute the lux command I do the following:
config4=$(cat config4.txt) golden4=$(cat golden4.txt) lux test4.lux

That way I am able to compare the content of that 2 files. But, is there a built in system to do that? or this is a "good" way?

Related to these question is another one. Am I able to use ?+ (undeterministic match) with the content loaded from a file?

Hope to hear you soon!

Thank you very much!
Jose

[if ... else ... ] block

Do you consider to implement support for if?

e.g.

[if $var="on"]
...
...
[else]
...
...
[endif]

It would be useful for cases, when we run tests in different environments and for some of them
only limited set of commands is available.

Thanks.

[doc] doesn't support printing variables

I prefer the format of [doc] over the format of [progress] for printing out values that are important to test cases (especially when debugging). However, the variable is printed out as a string literal "${var}" rather than printing the content of ${var}

Issues with Japanese characters in output

It seems that Lux mangles UTF-8 encoded Japanese characters.

actual.log:

<ERROR> 15-Sep-2016::10:43:07.660 VmGroupAction Did-12-Worker-35: - LOGICAL ERROR - createVmGroup. errno="unexpectedError", additionalInfo="未規定のエラーが発生しました。VM Group RPC blocked since create is ongoing", callerRequestId="2"

lux.event.log:

log(55): recv "<DEBUG> 15-Sep-2016::10:43:07.660 VmGroupAction Did-12-Worker-35: - NUMBER_OF_VMS: 2\r\n<ERROR> 15-Sep-2016::10:43:07.660 VmGroupAction Did-12-Worker-35: - LOGICAL ERROR - createVmGroup. errno="unexpectedError", additionalInfo="æ\234ªè¦\217å®\232ã\201®ã\202¨ã\203©ã\203¼ã\201\214ç\231ºç\224\237ã\201\227ã\201¾ã\201\227ã\201\237ã\200\202VM Group RPC blocked since create is ongoing", callerRequestId="2"\r\n"

lux.event.log.html:

<ERROR> 15-Sep-2016::10:43:07.768 DeleteVmGroupAction Did-11-Worker-29: - LOGICAL ERROR - deleteVmGroup. errno="unexpectedError", additionalInfo="<illegal char(s) - skipped 175 bytes - see plain lux log for details>
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC=en_US.utf8
LC_TIME=en_US.utf8
LC_COLLATE="en_US.utf8"
LC_MONETARY=en_US.utf8
LC_MESSAGES="en_US.utf8"
LC_PAPER=en_US.utf8
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT=en_US.utf8
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Could we add header for emacs/lux-mode.el?

Hi experts,

As we have [Conventional Headers for Emacs Libraries](https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Headers.html),

Spacemacs complains that emacs/lux-mode.el is missing a header so that it is not able to use the mode.

Error getting PACKAGE-DESC: (error Package lacks a file header)
(Spacemacs) Error: 

Could we add a header for it? This minor thing help a lot.

This [AutomaticFileHeaders](https://www.emacswiki.org/emacs/AutomaticFileHeaders) may interested.

Thank you a lot

Suggestion

Hakan, how hard would this be?

When writing reactive fastmap applications a common scenario for lux tests
is as follows (This applies to any async application, where the results of the
command may take some time to produce)

Using CLI:

!set x y
?[\ok]
set a b
?[ok]
!commit
?[ok]

The crux is that in RFM apps, the result isn't there after commit, it takes some
time to produce. I've now started to craft various custom script for this pattern,

!my-wait-scrip.sh foo bar baz
?WAIT_SCRIPT_OK

Where the script, in a loop, issues a command and expects some data.
Lux could support this, e.g think:

[try-loop 1 20]
!show status my-fastmap foo
?expected-output
[end try-loop]

Which then tries 20 times, with one sec between the attempts. On first success of all commands in the block we're good to go and can continue. I understand that this is exactly semantically the same as

[sleep 20]
!show status my-fastmap foo
?expected-output

Sleeps are really bad though.

Opinions ?

/klacke

Compilation issue - Lux don't work

Hi

when i'm trying to in compile LUX on Centos 7 i got this error:

[admin@nso5-srv1 lux-master]$ make
make[1]: Entering directory /home/admin/Lux/lux-master/src' "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_parse.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_utils.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_interpret.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_junit.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_log.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_main.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_parse.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_product.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_shell.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_suite.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_tap.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_trace.erl "/usr/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_utils.erl sed -e "s/%VSN%/2.8.1/g" < lux.app.src > ../ebin/lux.app make[1]: Leaving directory /home/admin/Lux/lux-master/src'
make[1]: Entering directory /home/admin/Lux/lux-master/c_src' gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c runpty.c: In function 'main': runpty.c:460:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[1]: Leaving directory /home/admin/Lux/lux-master/c_src'

also when i try to run Lux this is the error:

[admin@nso5-srv1 ~]$ /usr/local/bin/lux

FATAL ERROR: error:undef
[{lux_args,getopts,[[],"/usr/local/lib/lux","/usr/local/bin/lux"],[]},
{lux_main,unsafe_main,1,[{file,"lux_main.erl"},{line,22}]},
{lux_escript,main,1,[{file,"/usr/local/bin/lux"},{line,48}]},
{escript,run,2,[{file,"escript.erl"},{line,747}]},
{escript,start,1,[{file,"escript.erl"},{line,277}]},
{init,start_it,1,[]},
{init,start_em,1,[]}]

=ERROR REPORT==== 1-Jul-2022::09:47:28 ===
Loading of /usr/local/lib/lux/ebin/lux_args.beam failed: badfile

=ERROR REPORT==== 1-Jul-2022::09:47:28 ===
beam/beam_load.c(1158): Error loading module lux_args:
mandatory chunk of type 'Atom' not found

[admin@nso5-srv1 ~]$

i suppose for the error showing in compiling process.

what i did?

i did the autoconfigure, then modify the include.mk in ERLAC=" " i put the path to local erlc because the firt time i try to compile the path was populated to nso erlac application ("/home/odl/nso/5.3.6/bin/erlc" to ERLC="/usr/bin/erlc"
after that the ERLAN value is ok:

Erlang

ERL="/usr/bin/erl"
ERLC="/usr/bin/erlc"
EMULATOR=beam

then i run MAKE command as show on top and i got the error.

how could i can fix this and run properly Lux ?

latest_run symlink created with --log_dir set

Lux creates a latest_run link when using --log_dir, even though the documentation states it does not do that. With version 1.13.2.

If the configuration parameter --log_dir LogDir is set, the given path will be used instead and no symbolic link will be created.

$ lux --log_dir foo/bar
summary log       : /home/frehamma/work/ntte-aio/src/ntte-aio/test/lux/tailf-hcc/foo/bar/lux_summary.log

successful        : 0
summary           : WARNING

file:///home/frehamma/work/ntte-aio/src/ntte-aio/test/lux/tailf-hcc/foo/bar/lux_summary.log.html
$ ls -l foo
total 4
drwxr-xr-x 1 frehamma frehamma 140 May  3 21:37 bar
lrwxrwxrwx 1 frehamma frehamma   3 May  3 21:37 latest_run -> bar
$ 

No way to upgrade LUX version from 1.10 to 1.13

I cannot find a way to upgrade lux version from 1.10 to 1.13. I tried removal of lux directory and also /usr/local/lux/ directory but looks like something is still left to remove. Can someone provide the documentation to upgrade versions. I got the following error on make. I have erlang version R16BO3

rohinijain@ubuntu:~/lux$ make
make[1]: Entering directory /home/rohinijain/lux/src' "/home/rohinijain/ncs-4.0.3.1/ncs-4.0.3.1//bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux.erl "/home/rohinijain/ncs-4.0.3.1/ncs-4.0.3.1//bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_debug.erl "/home/rohinijain/ncs-4.0.3.1/ncs-4.0.3.1//bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_gen.erl "/home/rohinijain/ncs-4.0.3.1/ncs-4.0.3.1//bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html_parse.erl lux_html_parse.erl:13: can't find include lib "xmerl/include/xmerl.hrl" lux_html_parse.erl:186: record xmlElement undefined lux_html_parse.erl:189: variable 'Tag' is unbound lux_html_parse.erl:190: variable 'Attrs' is unbound lux_html_parse.erl:191: variable 'Content' is unbound lux_html_parse.erl:192: record xmlAttribute undefined lux_html_parse.erl:194: variable 'Tag' is unbound lux_html_parse.erl:194: variable 'Value' is unbound lux_html_parse.erl:195: record xmlText undefined lux_html_parse.erl:196: variable 'Text' is unbound lux_html_parse.erl:200: record xmlComment undefined make[1]: *** [../ebin/lux_html_parse.beam] Error 1 make[1]: Leaving directory/home/rohinijain/lux/src'
make[1]: Entering directory `/home/rohinijain/lux/c_src'
gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c
runpty.c: In function ‘main’:
runpty.c:98:11: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result]
setuid(getuid());
^

Large send commands (!) not returning prompt in lux

I've been poking at this for a little while and I'm at my wits' end. I would appreciate any direction/pointers. I'll include the relevant tidbits from files.

I have the following setup for a test suite:

  • package.luxinc [file w/ package-specific macros]
  • macro-27.luxinc [file w/ test-case specific macros, INCLUDE package.luxinc]
  • function-27.lux [main test file, INCLUDE macro-27.luxinc]

function-27:

[shell function-27-REST]
  [invoke setup]
  [invoke function27_rest $var1 $var2 $var3 $var4 $var5 $SOME_URL $SOME_FILE]
  !bash compare.sh ../expectedOutput $SOME_FILE
  ??True
  [invoke function27_rest $var1 $var2 $var3 $var4 $var5 $OTHER_URL $OTHER_FILE]
  !grep '201 Created' $OTHER_FILE
  ??HTTP/1.1 201 Created

macro-27.luxinc:

[macro function27_rest var1 var2 var3 var4 var5 URL FILE]
  """!echo '
  <GIANT XML BODY w/ access to above variables>
  </GIANT XML BODY>
  ' | curl -is -X POST -d @- -u admin:admin -H "Content-type: application/vnd.yang.data+xml" $URL >> $FILE
  """
  ?SH-PROMPT:
  !echo ==$?==
  ?==0==
[endmacro]

package.luxinc:

[macro setup]
  [progress 'Setup']
  !mkdir -p lux_logs/latest_run/output_files
  ?SH-PROMPT:
  !echo ==$?==
  ?==0==
[endmacro]

So, the main test script function-27 first calls setup from the package.luxinc, which just creates a directory. This works fine. The place where I encounter trouble is when the main test script calls function27rest from the macro-27.luxinc file, which echoes a large XML body to a cURL command then pipes the resulting return body into a file.

For whatever reason, when I expect the SH-PROMPT, it never returns. The part that really confuses me is that I have the same setup for multiple tests (i.e., function-28, function-29, etc...) and they all work except this one. The biggest difference I can think of between this one and the rest of the tests is that this one has the largest XML body. But I'm not sure exactly what problem that causes.

The following comments on this issue contain the output from the .stdin and .stdout of the test suite. Any help would be appreciated!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.