diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-01 11:14:58 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-01 11:14:58 +0300 |
commit | 78b25d9756403fef919684738f7aecb2cdcee465 (patch) | |
tree | d43f312f8f994be9d485dcc9c7c8ded3f415898f /tests | |
parent | f2ce145a8d27d18db064fc35313b7495f868b18b (diff) | |
download | eclat-78b25d9756403fef919684738f7aecb2cdcee465.tar.gz eclat-78b25d9756403fef919684738f7aecb2cdcee465.tar.bz2 |
Implement get-console-output command.
* etc/Makefile.am: Add new files.
* etc/get-console-output.fln: New file.
* lib/forlan.c: New built-in function "decode".
* lib/forlangrm.y: Fix grammar to allow functions to
return any data type, not only node.
* src/Makefile.am (eclat_SOURCES): Add new files.
* src/eclat.c: Register get-console-output command.
* src/eclat.h (eclat_get_console_output): New proto.
* src/getconout.c: New file.
* tests/Makefile.am: Add new files.
* tests/testsuite.at: Include new files.
* tests/decode.at: New test case.
* tests/get-console-output.at: New test case.
* tests/last.at: Minor change.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/decode.at | 28 | ||||
-rw-r--r-- | tests/get-console-output.at | 47 | ||||
-rw-r--r-- | tests/last.at | 2 | ||||
-rw-r--r-- | tests/testsuite.at | 2 |
5 files changed, 80 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 0f6a9c7..181f2f0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -41,11 +41,13 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac TESTSUITE_AT = \ associate-address.at\ + decode.at\ describe-addresses.at\ describe-instance-status.at\ describe-instances.at\ describe-tags.at\ describe-volumes.at\ + get-console-output.at\ dump01.at\ dump02.at\ forlan01.at\ diff --git a/tests/decode.at b/tests/decode.at new file mode 100644 index 0000000..208de1b --- /dev/null +++ b/tests/decode.at @@ -0,0 +1,28 @@ +# This file is part of Eclat -*- Autotest -*- +# Copyright (C) 2012 Sergey Poznyakoff +# +# Eclat is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Eclat is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Eclat. If not, see <http://www.gnu.org/licenses/>. + +AT_SETUP(base64 decode function) + +AT_DATA([prog],[ +print(decode("RXN0ZSBlcyB1biBudWV2byBkaWEgcGEnIGVtcGV6YXIgZGUgbnVldm8K")); +]) + +AT_CHECK([tforlan prog /dev/null], +[0], +[Este es un nuevo dia pa' empezar de nuevo +]) + +AT_CLEANUP
\ No newline at end of file diff --git a/tests/get-console-output.at b/tests/get-console-output.at new file mode 100644 index 0000000..70a6e21 --- /dev/null +++ b/tests/get-console-output.at @@ -0,0 +1,47 @@ +# This file is part of Eclat -*- Autotest -*- +# Copyright (C) 2012 Sergey Poznyakoff +# +# Eclat is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Eclat is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Eclat. If not, see <http://www.gnu.org/licenses/>. + +ECLAT_TEST_FORMAT([GetConsoleOutput], +[GetConsoleOutput], +[get-console-output.fln], +[<GetConsoleOutputResponse xmlns="http://ec2.amazonaws.com/doc/2012-08-15/"> + <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> + <instanceId>i-28a64341</instanceId> + <timestamp>2010-10-14T01:12:41.000Z</timestamp> + <output>TGludXggdmVyc2lvbiAyLjYuMTYteGVuVSAoYnVpbGRlckBwYXRjaGJhdC5hbWF6b25zYSkgKGdj +YyB2ZXJzaW9uIDQuMC4xIDIwMDUwNzI3IChSZWQgSGF0IDQuMC4xLTUpKSAjMSBTTVAgVGh1IE9j +dCAyNiAwODo0MToyNiBTQVNUIDIwMDYKQklPUy1wcm92aWRlZCBwaHlzaWNhbCBSQU0gbWFwOgpY +ZW46IDAwMDAwMDAwMDAwMDAwMDAgLSAwMDAwMDAwMDZhNDAwMDAwICh1c2FibGUpCjk4ME1CIEhJ +R0hNRU0gYXZhaWxhYmxlLgo3MjdNQiBMT1dNRU0gYXZhaWxhYmxlLgpOWCAoRXhlY3V0ZSBEaXNh +YmxlKSBwcm90ZWN0aW9uOiBhY3RpdmUKSVJRIGxvY2t1cCBkZXRlY3Rpb24gZGlzYWJsZWQKQnVp +bHQgMSB6b25lbGlzdHMKS2VybmVsIGNvbW1hbmQgbGluZTogcm9vdD0vZGV2L3NkYTEgcm8gNApF +bmFibGluZyBmYXN0IEZQVSBzYXZlIGFuZCByZXN0b3JlLi4uIGRvbmUuCg==</output> +</GetConsoleOutputResponse> +], +[Linux version 2.6.16-xenU (builder@patchbat.amazonsa) (gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) #1 SMP Thu Oct 26 08:41:26 SAST 2006 +BIOS-provided physical RAM map: +Xen: 0000000000000000 - 000000006a400000 (usable) +980MB HIGHMEM available. +727MB LOWMEM available. +NX (Execute Disable) protection: active +IRQ lockup detection disabled +Built 1 zonelists +Kernel command line: root=/dev/sda1 ro 4 +Enabling fast FPU save and restore... done. + +]) + + diff --git a/tests/last.at b/tests/last.at index 10c29c6..6aa4b27 100644 --- a/tests/last.at +++ b/tests/last.at @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Eclat. If not, see <http://www.gnu.org/licenses/>. -AT_SETUP([the last function]) +AT_SETUP([the last statement]) AT_KEYWORDS([forlan last]) AT_DATA([input],[// diff --git a/tests/testsuite.at b/tests/testsuite.at index f05baca..1776e3b 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -47,6 +47,7 @@ m4_include([dump02.at]) m4_include([print01.at]) m4_include([print02.at]) m4_include([print03.at]) +m4_include([decode.at]) m4_include([last.at]) m4_include([let.at]) m4_include([listall.at]) @@ -59,6 +60,7 @@ m4_include([describe-instance-status.at]) m4_include([describe-instances.at]) m4_include([describe-tags.at]) m4_include([describe-volumes.at]) +m4_include([get-console-output.at]) m4_include([start-instances.at]) m4_include([stop-instances.at]) |