キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
告知

JTAC-Mid-Career-Recruitment-2021.8

 

Luxイントロダクション1 インストール編

450
閲覧回数
0
いいね!
0
コメント

 

はじめに

Lux(LUcid eXpect scripting) は旧 Tail-f 社が開発したオープンソースのテストツールです。インタラクティブな操作を必要とするシステムのテストケースを、Expect ライクなインタフェースを使って簡単に記述することができます。

Lux は Github でホストされています。

 

このドキュメントでは、Lux のインストール方法を紹介します。

 

事前準備

Lux を使用するためには Erlang のランタイムが必要です。

事前に apt 等でインストールしてください。

sudo apt-get install erlang

 

インストール方法 ( Linux )

 

1) Lux リポジトリのクローン

~$ git clone https://github.com/hawk/lux.git
Cloning into 'lux'...
remote: Counting objects: 3129, done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 3129 (delta 43), reused 49 (delta 23), pack-reused 3036
Receiving objects: 100% (3129/3129), 2.70 MiB | 1.34 MiB/s, done.
Resolving deltas: 100% (2260/2260), done.
Checking connectivity... done.

 

2) autoconf コマンドを実行し、configure スクリプトをつくる

~/lux$ autoconf
~/lux$ ls configure
configure

 

3) configure スクリプトの実行

~/lux$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for dup2... yes
checking for select... yes
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
checking for markdown... no
configure: creating ./config.status
config.status: creating include.mk
configure: creating ./config.status
config.status: creating include.mk

 

4) make コマンド

~/lux$ make
make[1]: Entering directory `/home/user/lux/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_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_parse.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_utils.erl
sed -e "s/%VSN%/1.18.2/g" < lux.app.src > ../ebin/lux.app
make[1]: Leaving directory `/home/user/lux/src'
make[1]: Entering directory `/home/user/lux/c_src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/lux/c_src'
user@user_system:~/lux$ sudo make install
make[1]: Entering directory `/home/user/lux/src'
mkdir -p /usr/local/lux

 

5) make install

コマンド実行後、/usr/local/lux がつくられます。 

~/lux$ make install
make[1]: Entering directory `/home/user/lux/src'
mkdir -p /usr/local/lux
/home/user/lux/bin/lux --install /usr/local/lux
Installing lux as a standalone system... /usr/local/lux
WARNING: wx: Missing application directory.
if [ "/usr/local/lux/priv" != "/usr/local/lux/priv" ]; then \
          echo "# Added by Lux installer" >> /usr/local/lux/lib/lux-1.18.2/priv/luxcfg; \
          echo "[config config_dir=/usr/local/lux/priv]" >> /usr/local/lux/lib/lux-1.18.2/priv/luxcfg; \
        fi
make[1]: Leaving directory `/home/user/lux/src'
make[1]: Entering directory `/home/user/lux/c_src'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/home/user/lux/c_src'

インストール先を /usr/local/lux 以外にしたい場合は、以下のようにディレクトリを指定できます。 

DESTDIR=/foo/bar make install 

 

6) PATH に lux/bin を追加する

export PATH=$PATH:/usr/local/lux/bin

 

インストール方法 ( Mac )

 

1) Lux リポジトリのクローン

~$ git clone https://github.com/hawk/lux.git
Cloning into 'lux'...
remote: Counting objects: 3129, done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 3129 (delta 43), reused 49 (delta 23), pack-reused 3036
Receiving objects: 100% (3129/3129), 2.70 MiB | 1.34 MiB/s, done.
Resolving deltas: 100% (2260/2260), done.
Checking connectivity... done.

 

2) bin/lux のビルド

cd lux
bin/lux --make
Making lux...
Recompile: lux
Recompile: lux_case
lux_case.erl:72: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_debug
Recompile: lux_diff
lux_diff.erl:570: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_html_annotate
lux_html_annotate.erl:387: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_html_history
Recompile: lux_html_parse
Recompile: lux_html_utils
Recompile: lux_interpret
lux_interpret.erl:55: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_interpret.erl:616: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_interpret.erl:1260: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_junit
Recompile: lux_log
lux_log.erl:103: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_log.erl:301: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_parse
Recompile: lux_shell
lux_shell.erl:159: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_shell.erl:167: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_shell.erl:184: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_shell.erl:1396: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_suite
lux_suite.erl:87: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
lux_suite.erl:110: Warning: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace
Recompile: lux_tap
Recompile: lux_utils
Copy: lux.app
Compile: gcc -o priv/bin/runpty -g -O2 -Wall c_src/runpty.c

 

3) インストール 

ここではインストール先は /usr/local/lux としています。

mkdir /usr/local/lux
bin/lux --install /usr/local/lux Cloning into 'lux'... remote: Counting objects: 3129, done. remote: Compressing objects: 100% (66/66), done. remote: Total 3129 (delta 43), reused 49 (delta 23), pack-reused 3036 Receiving objects: 100% (3129/3129), 2.70 MiB | 1.34 MiB/s, done. Resolving deltas: 100% (2260/2260), done. Checking connectivity... done.

 

4) PATH に lux/bin を追加する

export PATH=$PATH:/usr/local/lux/bin

 

その他、インストール関連の情報は以下のドキュメントに記載されています。

https://github.com/hawk/lux/blob/master/INSTALL.md