summaryrefslogtreecommitdiffstats
path: root/lua/tests/030-config.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/tests/030-config.lua')
-rwxr-xr-xlua/tests/030-config.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/lua/tests/030-config.lua b/lua/tests/030-config.lua
new file mode 100755
index 00000000..a1325584
--- /dev/null
+++ b/lua/tests/030-config.lua
@@ -0,0 +1,42 @@
+#!/usr/bin/lua
+-- libguestfs Lua bindings -*- lua -*-
+-- Copyright (C) 2012 Red Hat Inc.
+--
+-- This program 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 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program 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 this program; if not, write to the Free Software
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+require "guestfs"
+
+local g = Guestfs.create ()
+
+local verbose = g:get_verbose ()
+g:set_verbose (true)
+g:set_verbose (verbose)
+
+g:set_autosync (false)
+g:set_autosync (true)
+
+g:set_path (".")
+if g:get_path () ~= "." then
+ error ()
+end
+
+g:add_drive ("/dev/null")
+
+local version = g:version ()
+for k,v in pairs (version) do
+ print(k,v)
+end
+
+g:close ()