diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-09-28 11:23:09 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-09-28 11:32:04 +0300 |
commit | ac1d6cbbcf5323d5db59886b98a24c45bafa64b8 (patch) | |
tree | f2a77092e072faa680b47d9d6d960e7214e46876 | |
parent | d902742081bc31a6eda274268da0178107e4abb4 (diff) | |
download | eclat-ac1d6cbbcf5323d5db59886b98a24c45bafa64b8.tar.gz eclat-ac1d6cbbcf5323d5db59886b98a24c45bafa64b8.tar.bz2 |
Improve testsuite. Reorganize directory structure.
* Makefile.am (SUBDIRS): Add etc
(distuninstallcheck_listfiles): Ignore *.forlan files.
* configure.ac: New options --split-format and --format-dir
* etc/Makefile.am: New file.
* etc/default.fln: New file.
* etc/describe-instance-status.fln: New file.
* etc/describe-instances.fln: New file.
* etc/describe-tags.fln: New file.
* etc/eclat.cfin: New file.
* etc/flncat.c: New file.
* etc/start-instances.fln: New file.
* etc/stop-instances.fln: New file.
* src/Makefile.am: Remove eclat.conf. It is built in /etc now.
* src/eclat.conf: Remove.
* src/cmdline.opt: Update.
* src/config.c: New configuration statement "format-file".
* src/eclat.c (format_file_option): New global.
(main): Read format from format-file, if supplied. Expand
keywords in its argument.
* src/eclat.h (format_file_option): New extern.
* tests/.gitignore: Update.
* tests/Makefile.am: Add new files.
* tests/describe-instance-status.at: New test case.
* tests/describe-instances.at: New test case.
* tests/describe-tags.at: New test case.
* tests/dscrinststat.at: New test case.
* tests/start-instances.at: New test case.
* tests/stop-instances.at: New test case.
* tests/testsuite.at (ECLAT_TEST_FORMAT): New macro.
Include new test cases.
* tests/trws.c: New file.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | etc/.gitignore | 3 | ||||
-rw-r--r-- | etc/Makefile.am | 60 | ||||
-rw-r--r-- | etc/default.fln | 22 | ||||
-rw-r--r-- | etc/describe-instance-status.fln | 36 | ||||
-rw-r--r-- | etc/describe-instances.fln | 69 | ||||
-rw-r--r-- | etc/describe-tags.fln | 24 | ||||
-rw-r--r-- | etc/eclat.cfin | 32 | ||||
-rw-r--r-- | etc/flncat.c | 94 | ||||
-rw-r--r-- | etc/start-instances.fln | 23 | ||||
-rw-r--r-- | etc/stop-instances.fln | 23 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/cmdline.opt | 2 | ||||
-rw-r--r-- | src/config.c | 4 | ||||
-rw-r--r-- | src/eclat.c | 72 | ||||
-rw-r--r-- | src/eclat.conf | 165 | ||||
-rw-r--r-- | src/eclat.h | 1 | ||||
-rw-r--r-- | tests/.gitignore | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/describe-instance-status.at | 154 | ||||
-rw-r--r-- | tests/describe-instances.at | 274 | ||||
-rw-r--r-- | tests/describe-tags.at | 68 | ||||
-rw-r--r-- | tests/dscrinststat.at | 128 | ||||
-rw-r--r-- | tests/start-instances.at | 38 | ||||
-rw-r--r-- | tests/stop-instances.at | 39 | ||||
-rw-r--r-- | tests/testsuite.at | 17 | ||||
-rw-r--r-- | tests/trws.c | 46 |
28 files changed, 1245 insertions, 194 deletions
diff --git a/Makefile.am b/Makefile.am index 171250b..d78d1f6 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | ACLOCAL_AMFLAGS = -I grecs/am | 17 | ACLOCAL_AMFLAGS = -I grecs/am |
18 | 18 | ||
19 | SUBDIRS = grecs lib src tests | 19 | SUBDIRS = grecs lib src etc tests |
20 | 20 | ||
21 | .PHONY: ChangeLog | 21 | .PHONY: ChangeLog |
22 | ChangeLog: | 22 | ChangeLog: |
@@ -25,4 +25,4 @@ ChangeLog: | |||
25 | awk -f $(top_srcdir)/grecs/build-aux/git2chg.awk > ChangeLog; \ | 25 | awk -f $(top_srcdir)/grecs/build-aux/git2chg.awk > ChangeLog; \ |
26 | fi | 26 | fi |
27 | 27 | ||
28 | distuninstallcheck_listfiles = find . -type f -not -name 'eclat.conf' -print | 28 | distuninstallcheck_listfiles = find . -type f -not -name 'eclat.conf' -not -name '*.forlan' -print |
diff --git a/configure.ac b/configure.ac index 8f8ccfc..7c744ff 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -63,6 +63,29 @@ AC_CHECK_LIB([expat], [XML_Parse],[], | |||
63 | 63 | ||
64 | GRECS_SETUP([grecs],[tests getopt git2chg]) | 64 | GRECS_SETUP([grecs],[tests getopt git2chg]) |
65 | 65 | ||
66 | # | ||
67 | AC_SUBST(FORMATDIR) | ||
68 | AC_ARG_ENABLE([split-format], | ||
69 | [AC_HELP_STRING([--enable-split-format], | ||
70 | [build split format files])], | ||
71 | [split_fmt=$enableval], | ||
72 | [split_fmt=no]) | ||
73 | |||
74 | if test $split_fmt = yes; then | ||
75 | FORMATDIR="\$(sysconfdir)/\$(PACKAGE)" | ||
76 | else | ||
77 | FORMATDIR="\$(sysconfdir)" | ||
78 | fi | ||
79 | AM_CONDITIONAL([SPLIT_FORMATS],[test $split_fmt = yes]) | ||
80 | |||
81 | AC_ARG_WITH([format-dir], | ||
82 | [AC_HELP_STRING([--format-dir=DIR], | ||
83 | [install format files to that directory])], | ||
84 | [case $withval in | ||
85 | /*) FORMATDIR=$withval;; | ||
86 | *) FORMATDIR='$(prefix)/'$withval | ||
87 | esac]) | ||
88 | |||
66 | # Initialize the test suite. | 89 | # Initialize the test suite. |
67 | AC_CONFIG_TESTDIR(tests) | 90 | AC_CONFIG_TESTDIR(tests) |
68 | AC_CONFIG_FILES([tests/Makefile tests/atlocal]) | 91 | AC_CONFIG_FILES([tests/Makefile tests/atlocal]) |
@@ -70,7 +93,8 @@ AM_MISSING_PROG([AUTOM4TE], [autom4te]) | |||
70 | 93 | ||
71 | AC_CONFIG_FILES([Makefile | 94 | AC_CONFIG_FILES([Makefile |
72 | lib/Makefile | 95 | lib/Makefile |
73 | src/Makefile]) | 96 | src/Makefile |
97 | etc/Makefile]) | ||
74 | 98 | ||
75 | AC_OUTPUT | 99 | AC_OUTPUT |
76 | 100 | ||
diff --git a/etc/.gitignore b/etc/.gitignore new file mode 100644 index 0000000..b22bf5d --- /dev/null +++ b/etc/.gitignore | |||
@@ -0,0 +1,3 @@ | |||
1 | *.forlan | ||
2 | eclat.conf | ||
3 | flncat | ||
diff --git a/etc/Makefile.am b/etc/Makefile.am new file mode 100644 index 0000000..5eec565 --- /dev/null +++ b/etc/Makefile.am | |||
@@ -0,0 +1,60 @@ | |||
1 | # This file is part of Eclat | ||
2 | # Copyright (C) 2012 Sergey Poznyakoff | ||
3 | # | ||
4 | # Eclat is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published by | ||
6 | # the Free Software Foundation; either version 3, or (at your option) | ||
7 | # any later version. | ||
8 | # | ||
9 | # Eclat is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with Eclat. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | noinst_PROGRAMS = flncat | ||
18 | |||
19 | FLNFILES=\ | ||
20 | describe-instance-status.fln\ | ||
21 | describe-instances.fln\ | ||
22 | describe-tags.fln\ | ||
23 | start-instances.fln\ | ||
24 | stop-instances.fln | ||
25 | |||
26 | EXTRA_DIST=$(FLNFILES) default.fln eclat.cfin | ||
27 | |||
28 | noinst_SCRIPTS=eclat.conf | ||
29 | CLEANFILES=eclat.conf | ||
30 | SUFFIXES=.cfin .conf | ||
31 | |||
32 | if SPLIT_FORMATS | ||
33 | SUFFIXES += .forlan .fln | ||
34 | .fln.forlan: | ||
35 | $(AM_V_GEN)$(abs_builddir)/flncat $< default.fln > $@ | ||
36 | formatdir = @FORMATDIR@ | ||
37 | noinst_SCRIPTS += $(FLNFILES:.fln=.forlan) | ||
38 | CLEANFILES += $(FLNFILES:.fln=.forlan) | ||
39 | FORMATNAME = $${command} | ||
40 | else | ||
41 | formatdir = @FORMATDIR@ | ||
42 | noinst_SCRIPTS += eclat.forlan | ||
43 | CLEANFILES += eclat.forlan | ||
44 | eclat.forlan: $(FLNFILES) default.fln | ||
45 | $(AM_V_GEN)(cd $(srcdir); $(abs_builddir)/flncat $(FLNFILES) default.fln) > eclat.forlan | ||
46 | FORMATNAME = eclat | ||
47 | endif | ||
48 | |||
49 | .cfin.conf: | ||
50 | $(AM_V_GEN)sed 's^FORMATDIR^$(formatdir)^;s^FORMATNAME^$(FORMATNAME)^' $< > $@ | ||
51 | |||
52 | install-data-local: | ||
53 | @test -z "$(DESTDIR)$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)" | ||
54 | @if [ -r $(DESTDIR)$(sysconfdir)/eclat.conf ]; then :; \ | ||
55 | else ${INSTALL} -m 644 $(top_srcdir)/src/eclat.conf \ | ||
56 | $(DESTDIR)$(sysconfdir)/eclat.conf; \ | ||
57 | for file in $(noinst_SCRIPTS); do \ | ||
58 | ${INSTALL} -m 644 $$file $(DESTDIR)$(formatdir)/$$file; \ | ||
59 | done; \ | ||
60 | fi | ||
diff --git a/etc/default.fln b/etc/default.fln new file mode 100644 index 0000000..2e2f690 --- /dev/null +++ b/etc/default.fln | |||
@@ -0,0 +1,22 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2012 Sergey Poznyakoff. | ||
3 | |||
4 | Eclat is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | Eclat is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | if (.Response.Errors) | ||
18 | error("Error: ",.Response.Errors.Error.Message,"\n"); | ||
19 | else { | ||
20 | error("Unrecognized response:\n"); | ||
21 | dump(.); | ||
22 | } | ||
diff --git a/etc/describe-instance-status.fln b/etc/describe-instance-status.fln new file mode 100644 index 0000000..85b88b3 --- /dev/null +++ b/etc/describe-instance-status.fln | |||
@@ -0,0 +1,36 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2012 Sergey Poznyakoff. | ||
3 | |||
4 | Eclat is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | Eclat is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | if (.DescribeInstanceStatusResponse.instanceStatusSet) { | ||
18 | for (var in .DescribeInstanceStatusResponse.instanceStatusSet.item) { | ||
19 | print(var.instanceId,"\t", | ||
20 | var.availabilityZone,"\t", | ||
21 | var.instanceState.name); | ||
22 | if (var.instanceState.name[running]) { | ||
23 | print("\t",var.systemStatus.status); | ||
24 | for (detail in var.systemStatus.details.item) { | ||
25 | print("\tSys.",detail.name,"=",detail.status); | ||
26 | } | ||
27 | for (detail in var.instanceStatus.details.item) { | ||
28 | print("\tInst.",detail.name,"=",detail.status); | ||
29 | } | ||
30 | } | ||
31 | print("\n"); | ||
32 | for (event in var.eventsSet.item) { | ||
33 | error(var.instanceId,"\t","Event: ", event.description,"\n"); | ||
34 | } | ||
35 | } | ||