Ticket #53 (closed bug: fixed)

Opened 2 years ago

Last modified 11 months ago

Failure with perl -Ilib/ t/honeyclient_manager_vm.t

Reported by: mike@shadowserver.org Assigned to: kindlund
Priority: normal Milestone: 0.9
Component: Documentation Version: 0.96
Severity: minor Keywords: unit test, vm, manager, xml, datastore, snapshot, path
Cc:

Description (Last modified by kindlund)

When running the command "perl -Ilib/ t/honeyclient_manager_vm.t" as listed in the docs, I got the following error. Doing some digging, I found it was because I wasn't using the expected "/vm" as my virtual machine path. I made the following two changes to etc/honeyclient.xml (the snapshots error came up after I fixed the first):

            <datastore_path description="The absolute path to the parent directory, where all HoneyClient VM data is stored on the host server.  It is assumed that individual VM data is stored in separate subdirectories within this parent directory." default="/vm">
                /home/vms <!-- THIS IS MY PATH FOR VMS -->
            </datastore_path>
            <!-- TODO: Update this. -->
            <snapshot_path description="The absolute path to the directory that contains all snapshot data, associated with every HoneyClient VM." default="/vm/snapshots">
                /home/vms/snapshots <!-- THIS IS A DIRECTORY I CREATED -->
            </snapshot_path>

I saw the /vm/snapshots bug, but it seems these both could be resolved with a documentation change for folks to edit etc/honeyclient.xml

ok 1 - use Log::Log4perl;
ok 2 - use HoneyClient::Util::Config;
not ok 3 - use HoneyClient::Manager::VM;
#   Failed test 'use HoneyClient::Manager::VM;'
#   at t/honeyclient_manager_vm.t line 58.
#     Tried to use 'HoneyClient::Manager::VM'.
#     Error:  Error: Current datastore path (/vm) does not exist!
#  at (eval 39) line 2
# Compilation failed in require at (eval 39) line 2.
# BEGIN failed--compilation aborted at t/honeyclient_manager_vm.t line 58.
# Can't load HoneyClient::Manager:VM package.  Check to make sure the package library is correctly listed within the path.
ok 4 - use HoneyClient::Util::SOAP;
ok 5 - use File::Basename;
ok 6 - use File::Copy::Recursive;
ok 7 - use Data::Dumper;
ok 8 - use File::stat;
ok 9 - use Digest::MD5;
ok 10 - use DateTime::HiRes;
ok 11 - use Fcntl;
ok 12 - use VMware::VmPerl;
ok 13 - use VMware::VmPerl::Server;
ok 14 - use VMware::VmPerl::ConnectParams;
ok 15 - use VMware::VmPerl::VM;
ok 16 - use VMware::VmPerl::Question;
ok 17 - use threads;
ok 18 - use threads::shared;
ok 19 - use Thread::Queue;
ok 20 - use Thread::Semaphore;
# Note: These unit tests *expect* the VMware Server / GSX daemon to be operational on this system beforehand.
ok 21 - require Log::Log4perl;
ok 22 - require HoneyClient::Util::Config;
ok 23 - HoneyClient::Util::Config->can('getVar')
ok 24 - require HoneyClient::Manager::VM;
ok 25 - HoneyClient::Manager::VM->can('init')
ok 26 - HoneyClient::Manager::VM->can('destroy')
ok 27 - require HoneyClient::Util::SOAP;
ok 28 - HoneyClient::Util::SOAP->can('getServerHandle')
ok 29 - HoneyClient::Util::SOAP->can('getClientHandle')
ok 30 - require File::Basename;
ok 31 - File::Basename->can('dirname')
ok 32 - File::Basename->can('basename')
ok 33 - require File::Copy::Recursive;
ok 34 - File::Copy::Recursive->can('dircopy')
ok 35 - File::Copy::Recursive->can('pathrmdir')
ok 36 - require Data::Dumper;
ok 37 - require File::stat;
ok 38 - require Digest::MD5;
ok 39 - Digest::MD5->can('md5_hex')
ok 40 - require DateTime::HiRes;
ok 41 - require Fcntl;
ok 42 - require VMware::VmPerl;
ok 43 - require VMware::VmPerl::Server;
ok 44 - require VMware::VmPerl::ConnectParams;
ok 45 - require VMware::VmPerl::VM;
ok 46 - require VMware::VmPerl::Question;
ok 47 - require threads;
ok 48 - require threads::shared;
ok 49 - require Thread::Queue;
ok 50 - require Thread::Semaphore;
Can't call method "dequeue_nb" on an undefined value at lib//HoneyClient/Manager/VM.pm line 875.
END failed--call queue aborted.
1..50
# Looks like you failed 1 test of 50.
# Looks like your test died just after 50.

Attachments

Change History

04/08/07 22:17:09 changed by kindlund

  • status changed from new to assigned.
  • description changed.

Hi Mike,

I'll try to test this issue on Monday (9th). To be clear, which version of the code were you testing? Was it the trunk, or the latest stable release?

Regards, — Darien

04/09/07 09:03:34 changed by mike@shadowserver.org

This was with 0.95. I didn't even think to try the svn version.

Thanks, Mike

04/09/07 14:22:45 changed by kindlund

Hi Mike,

To be clear, you've stated that the issue is primarily a documentation one. Meaning that the documentation should tell the user (when configuring the host system), to be sure to set those to XML elements within the etc/honeyclient.xml file. Correct?

If so, in the UserGuide, check out step #14 under Configure HoneyClient::Manager.

http://www.honeyclient.org/trac/wiki/UserGuide#ConfigureHoneyClient::Manager

You'll see that we ask the user to edit their etc/honeyclient.xml in order to make sure that the datastore_path and that the snapshot_path both point to valid directories.

The problem is that this configuration occurs AFTER step #12, which is where we ask the user to run the unit test. Ah, now I get it. So we need to tell the user to configure these XML elements BEFORE running the unit tests in step #12, else they will end up with the problem you've described.

Okay, I'll update the UserGuide documentation accordingly. Thanks very much for your help! Please let me know if I missed anything else, regarding this issue.

Regards, Darien

04/09/07 14:47:31 changed by kindlund

  • status changed from assigned to closed.
  • severity changed from none to minor.
  • component changed from HoneyClient::Manager::VM to Documentation.
  • milestone set to 0.9.
  • keywords set to unit test, vm, manager, xml, datastore, snapshot, path.
  • resolution set to fixed.

08/29/07 14:23:14 changed by kindlund

  • version changed from none to 0.96.

Add/Change #53 (Failure with perl -Ilib/ t/honeyclient_manager_vm.t)




Change Properties
Action