I'm less interested in test cases than patches that allow it to compile.
Building C object src/CMakeFiles/mnet.dir/lib/network.c.obj cd /builddir/build/BUILD/matahari-0.4.0/src && /usr/bin/i686-pc-mingw32-gcc -Dmnet_EXPORTS -DSUPPORT_TRACING=0 -DMATAHARI_PORT=49000 -DMATAHARI_BROKER="127.0.0.1" -DQPID_VERSION=" qpid-0" -Wall -O3 -DNDEBUG -I/builddir/build/BUILD/matahari-0.4.0/src -I/builddir/build/BUILD/matahari-0.4.0/src/include -I/usr/i686-pc-mingw32/sys-root/mingw/include -I/usr/i686-pc-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include -o CMakeFiles/mnet.dir/lib/network.c.obj -c /builddir/build/BUILD/matahari-0.4.0/src/lib/network.c /builddir/build/BUILD/matahari-0.4.0/src/lib/network.c: In function 'network_get_ip_address': /builddir/build/BUILD/matahari-0.4.0/src/lib/network.c:113: warning: implicit declaration of function 'sigar_net_address_to_string' /usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/matahari-0.4.0/CMakeFiles 36 /usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/matahari-0.4.0/CMakeFiles 34 [ 13%] [ 15%] Building C object src/CMakeFiles/mnet.dir/lib/network_windows.c.obj cd /builddir/build/BUILD/matahari-0.4.0/src && /usr/bin/i686-pc-mingw32-gcc -Dmnet_EXPORTS -DSUPPORT_TRACING=0 -DMATAHARI_PORT=49000 -DMATAHARI_BROKER="127.0.0.1" -DQPID_VERSION=" qpid-0" -Wall -O3 -DNDEBUG -I/builddir/build/BUILD/matahari-0.4.0/src -I/builddir/build/BUILD/matahari-0.4.0/src/include -I/usr/i686-pc-mingw32/sys-root/mingw/include -I/usr/i686-pc-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include -o CMakeFiles/mnet.dir/lib/network_windows.c.obj -c /builddir/build/BUILD/matahari-0.4.0/src/lib/network_windows.c Building C object src/CMakeFiles/mhost.dir/lib/host_windows.c.obj cd /builddir/build/BUILD/matahari-0.4.0/src && /usr/bin/i686-pc-mingw32-gcc -Dmhost_EXPORTS -DSUPPORT_TRACING=0 -DMATAHARI_PORT=49000 -DMATAHARI_BROKER="127.0.0.1" -DQPID_VERSION=" qpid-0" -Wall -O3 -DNDEBUG -I/builddir/build/BUILD/matahari-0.4.0/src -I/builddir/build/BUILD/matahari-0.4.0/src/include -I/usr/i686-pc-mingw32/sys-root/mingw/include -I/usr/i686-pc-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include -o CMakeFiles/mhost.dir/lib/host_windows.c.obj -c /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c /builddir/build/BUILD/matahari-0.4.0/src/lib/network_windows.c: In function 'network_os_stop': /builddir/build/BUILD/matahari-0.4.0/src/lib/network_windows.c:45: warning: unused variable 'ok' /builddir/build/BUILD/matahari-0.4.0/src/lib/network_windows.c: In function 'network_os_start': /builddir/build/BUILD/matahari-0.4.0/src/lib/network_windows.c:72: warning: unused variable 'ok' Linking C shared library libmnet.dll cd /builddir/build/BUILD/matahari-0.4.0/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/mnet.dir/link.txt --verbose=1 /usr/bin/i686-pc-mingw32-gcc -shared -o libmnet.dll -Wl,--out-implib,libmnet.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/mnet.dir/lib/network.c.obj CMakeFiles/mnet.dir/lib/network_windows.c.obj libmcommon.dll.a -lwsock32 -lglib-2.0 -lintl /usr/i686-pc-mingw32/sys-root/mingw/bin/libsigar.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c: In function 'host_os_shutdown': /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:84: warning: 'token' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c: In function 'host_os_reboot': /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:73: warning: 'token' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c: In function 'host_os_shutdown': /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:82: warning: 'tkp.Privileges[0u].Attributes' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:82: warning: 'tkp.Privileges[0u].Luid.HighPart' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:82: warning: 'tkp.Privileges[0u].Luid.LowPart' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:82: warning: 'tkp.PrivilegeCount' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c: In function 'host_os_reboot': /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:71: warning: 'tkp.Privileges[0u].Attributes' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:71: warning: 'tkp.Privileges[0u].Luid.HighPart' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:71: warning: 'tkp.Privileges[0u].Luid.LowPart' is used uninitialized in this function /builddir/build/BUILD/matahari-0.4.0/src/lib/host_windows.c:71: warning: 'tkp.PrivilegeCount' is used uninitialized in this function Creating library file: libmnet.dll.a CMakeFiles/mnet.dir/lib/network.c.obj:network.c:(.text+0x26d): undefined reference to `_sigar_net_address_to_string' collect2: ld returned 1 exit status make[2]: Leaving directory `/builddir/build/BUILD/matahari-0.4.0' make[2]: *** [src/libmnet.dll] Error 1 make[1]: *** [src/CMakeFiles/mnet.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
On Mon, Jan 3, 2011 at 9:01 PM, Adam Stokes astokes@fedoraproject.org wrote:
src/tests/Rakefile | 29 ++++++++++++++++++++++++++ src/tests/agent.rb | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 src/tests/Rakefile create mode 100644 src/tests/agent.rb
diff --git a/src/tests/Rakefile b/src/tests/Rakefile new file mode 100644 index 0000000..a343e7d --- /dev/null +++ b/src/tests/Rakefile @@ -0,0 +1,29 @@ +# +# Rakefile: ruby build helpers +# +# Copyright (C) 2010 Red Hat Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Author: Adam Stokes astokes@fedoraproject.org +#
+require 'rake/clean' +require 'rake/testtask' +require 'pathname'
+Rake::TestTask.new(:test) do |t|
- t.test_files = FileList['*.rb']
+end diff --git a/src/tests/agent.rb b/src/tests/agent.rb new file mode 100644 index 0000000..016f36c --- /dev/null +++ b/src/tests/agent.rb @@ -0,0 +1,58 @@ +# +# agent.rb: test routines for matahari agents +# +# Copyright (C) 2010 Red Hat Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Author: Adam Stokes astokes@fedoraproject.org +#
+require 'test/unit' +require 'cqpid' +require 'qmf2'
+class AgentSetup < Test::Unit::TestCase
- def setup
- @connection = Cqpid::Connection.new("localhost:49000")
- @connection.open
- @session = Qmf2::ConsoleSession.new(@connection)
- @session.open
- end
- def teardown
- @session.close if @session
- @connection.close if @connection
- end
- def test_agents
- @session.set_agent_filter("[eq, _vendor, [quote, 'matahariproject.org']]")
- net_agent = nil
- count = 0
- while :true
- agent_list = @session.agents
- agent_list.each do |agent|
- net_agent = agent if agent.product == 'net'
- end
- break if net_agent
- count = count + 1
- assert(count < 5)
- sleep(1)
- end
- network_agent = net_agent.query("{class:network, package:'org.matahariproject'}")
- assert_equal(1, network_agent.length)
- end
+end
1.7.3.4
Matahari mailing list Matahari@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/matahari