cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
694
Views
0
Helpful
1
Replies

LUX Test on Cisco NSO on Centos SO

Maurizio Bau
Level 1
Level 1

Hi Guys

 

I'll tried to execute a LUX test on Cisco NSO 5.3 installed on a VM with Centos SO but 'i've an error

 

/var/opt/ncs/packages/OPC_GRX/test/internal/lux/service
[15:45:49]-nso:_NIZZA_$ lux run.lux 

=ERROR REPORT==== 23-May-2022::15:45:56 ===
Loading of /usr/local/lib/lux/ebin/lux_case.beam failed: badfile


FATAL ERROR: /var/opt/ncs/workspace/OPC_GRX/OPC_GRX_2022-05-13/test/internal/lux/service/lux_logs/run_2022_05_23_13_45_56_859128/lux_summary.log:
        error:undef
        [{lux_case,default_istate,["/usr/local/lib/lux/priv/luxcfg"],[]},
         {lux_parse,parse_file,6,[{file,"lux_parse.erl"},{line,28}]},
         {lux_suite,parse_config_file,2,[{file,"lux_suite.erl"},{line,904}]},
         {lux_suite,parse_config,1,[{file,"lux_suite.erl"},{line,830}]},
         {lux_suite,run,4,[{file,"lux_suite.erl"},{line,56}]},
         {lux_main,run,4,[{file,"/usr/local/bin/lux"},{line,1192}]},
         {lux_main,main,1,[{file,"/usr/local/bin/lux"},{line,61}]},
         {escript,run,2,[{file,"escript.erl"},{line,747}]}]

=ERROR REPORT==== 23-May-2022::15:45:56 ===
beam/beam_load.c(1158): Error loading module lux_case:
  mandatory chunk of type 'Atom' not found

Do you have any idea to solve this problem

Thanks

Maurizio

1 Accepted Solution

Accepted Solutions

Alexander Stevenson
Cisco Employee
Cisco Employee

 

Hello @Maurizio Bau,

 

I recently wrote a blog about Expect, which Lux is based on, so I have a (very) basic idea of how this works. Knowing that, I found the following:

 

A .beam file is an executable file generated by the Erlang compiler, a program used for building BEAM files from .ERL source code files; saved in a binary format, called bytecode, and can be run with the Erlang virtual machine (VM)

 

The error message stating mandatory chunk of type 'Atom' not found suggests that you have a .beam file compiled with a later Erlang/OTP version, and are trying to load it in an earlier version (or vice versa?). I’ve seen at least one example where downgrading the Elixir version solves this. Ultimately, finding versions of Elixir and Erlang which are known-compatible is the goal. To help with this, try running LUX in Erlang debugger or use Erlang trace.

 

This Use Case on DevNet Automation Exchange may be helpful as well:
Using `Lux` for fast transition from manual to automated testing

 

 

If all else fails, I recommend opening an issue on the Lux GitHub repo: https://github.com/hawk/lux/issues

 

Hope this helps!

View solution in original post

1 Reply 1

Alexander Stevenson
Cisco Employee
Cisco Employee

 

Hello @Maurizio Bau,

 

I recently wrote a blog about Expect, which Lux is based on, so I have a (very) basic idea of how this works. Knowing that, I found the following:

 

A .beam file is an executable file generated by the Erlang compiler, a program used for building BEAM files from .ERL source code files; saved in a binary format, called bytecode, and can be run with the Erlang virtual machine (VM)

 

The error message stating mandatory chunk of type 'Atom' not found suggests that you have a .beam file compiled with a later Erlang/OTP version, and are trying to load it in an earlier version (or vice versa?). I’ve seen at least one example where downgrading the Elixir version solves this. Ultimately, finding versions of Elixir and Erlang which are known-compatible is the goal. To help with this, try running LUX in Erlang debugger or use Erlang trace.

 

This Use Case on DevNet Automation Exchange may be helpful as well:
Using `Lux` for fast transition from manual to automated testing

 

 

If all else fails, I recommend opening an issue on the Lux GitHub repo: https://github.com/hawk/lux/issues

 

Hope this helps!