UHD USRP device lacks capacity - redhawksdr

I'm using Redhawk 1.10.0 on a CentOS 6.5 machine 64 bit and USRP b100 with UHD driver 3.7.2.
The USRP b100 is recognized correctly by the system. It is a USB device.
I downloaded the latest version of UHD_USRP Device ver. 3.0 for REDHAWK and I created a Node including a GPP and a UHD_USRP devices.
The Node is started without any problem but when I run a simple waveform to read data from the USRP as a RX_DIGITIZER I got the following error:
Failed to create application: usrp_test_248_173059195 Failed to satisfy 'usesdevice'
dependencies DCE:18964b3d-392e-4b98-a90d-0569b5d46ffefor application 'usrp_test_248_173059195'
IDL:CF/ApplicationFactory/CreateApplicationError:1.0
The log of the Device Manager reports that:
2014-09-05 17:31:03 TRACE FrontendTunerDevice:369 - CORBA::Boolean frontend::FrontendTunerDevice<TunerStatusStructType>::allocateCapacity(const CF::Properties&) [with TunerStatusStructType = frontend_tuner_status_struct_struct]
2014-09-05 17:31:03 INFO FrontendTunerDevice:502 - allocateCapacity: NO AVAILABLE TUNER. Make sure that the device has an initialized frontend_tuner_status
2014-09-05 17:31:03 TRACE FrontendTunerDevice:578 - void frontend::FrontendTunerDevice<TunerStatusStructType>::deallocateCapacity(const CF::Properties&) [with TunerStatusStructType = frontend_tuner_status_struct_struct]
2014-09-05 17:31:03 DEBUG FrontendTunerDevice:603 - ALLOCATION_ID NOT FOUND: [usrpAllocation]
2014-09-05 17:31:03 DEBUG FrontendTunerDevice:637 - ERROR WHEN DEALLOCATING. SKIPPING...
The Node console:
2014-09-05 17:31:39 TRACE ApplicationFactory_impl:2132 - Done building Component Info From SPD File
2014-09-05 17:31:39 TRACE ApplicationFactory_impl:1040 - Application has 1 usesdevice dependencies
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::allocation_id
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::bandwidth
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::center_frequency
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::group_id
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::rf_flow_id
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::sample_rate
2014-09-05 17:31:39 TRACE prop_utils:509 - setting struct item FRONTEND::tuner_allocation::tuner_type
2014-09-05 17:31:39 TRACE AllocationManager_impl:134 - Servicing 1 allocation request(s)
2014-09-05 17:31:39 TRACE AllocationManager_impl:144 - Allocation request DCE:18964b3d-392e-4b98-a90d-0569b5d46ffe contains 3 properties
2014-09-05 17:31:39 TRACE AllocationManager_impl:243 - Allocating against device uhd_node:USRP_UHD_1
2014-09-05 17:31:39 TRACE AllocationManager_impl:353 - Matching DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d 'FRONTEND::TUNER' eq 'FRONTEND::TUNER'
2014-09-05 17:31:39 TRACE AllocationManager_impl:353 - Matching DCE:0f99b2e4-9903-4631-9846-ff349d18ecfb 'USRP' eq 'USRP'
2014-09-05 17:31:39 TRACE AllocationManager_impl:395 - Adding external property FRONTEND::tuner_allocation
2014-09-05 17:31:39 TRACE AllocationManager_impl:407 - Matched 2 properties
2014-09-05 17:31:39 TRACE AllocationManager_impl:264 - Allocating 1 properties (1 calls)
2014-09-05 17:31:39 TRACE AllocationManager_impl:267 - Device lacks sufficient capacity
2014-09-05 17:31:39 TRACE AllocationManager_impl:243 - Allocating against device uhd_node:GPP_1
2014-09-05 17:31:39 TRACE AllocationManager_impl:353 - Matching DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d 'GPP' eq 'FRONTEND::TUNER'
2014-09-05 17:31:39 TRACE AllocationManager_impl:248 - Matching failed
2014-09-05 17:31:39 DEBUG ApplicationFactory_impl:1060 - Failed to satisfy 'usesdevice' dependencies DCE:18964b3d-392e-4b98-a90d-0569b5d46ffefor application 'usrp_test_248_173059195'
2014-09-05 17:31:39 TRACE ApplicationFactory_impl:528 - Unbinding the naming context
2014-09-05 17:31:39 TRACE Properties:85 - Destruction for properties
2014-09-05 17:31:39 TRACE PRF:312 - Deleting PRF containing 4 properties
I used the following parameters:
<usesdevicedependencies>
<usesdevice id="DCE:18964b3d-392e-4b98-a90d-0569b5d46ffe"
type="usesUSRP">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d"
value="FRONTEND::TUNER" />
<propertyref refid="DCE:0f99b2e4-9903-4631-9846-ff349d18ecfb"
value="USRP" />
<structref refid="FRONTEND::tuner_allocation">
<simpleref refid="FRONTEND::tuner_allocation::tuner_type"
value="RX_DIGITIZER" />
<simpleref refid="FRONTEND::tuner_allocation::allocation_id"
value="usrpAllocation" />
<simpleref refid="FRONTEND::tuner_allocation::center_frequency"
value="102500000" />
<simpleref refid="FRONTEND::tuner_allocation::bandwidth"
value="320000" />
<simpleref refid="FRONTEND::tuner_allocation::sample_rate"
value="250000" />
<simpleref refid="FRONTEND::tuner_allocation::group_id"
value="" />
<simpleref refid="FRONTEND::tuner_allocation::rf_flow_id"
value="" />
</structref>
</usesdevice>
</usesdevicedependencies>
The b100 configuration is the following:
-- USRP-B100 clock control: 10
-- r_counter: 2
-- a_counter: 0
-- b_counter: 20
-- prescaler: 8
-- vco_divider: 5
-- chan_divider: 5
-- vco_rate: 1600.000000MHz
-- chan_rate: 320.000000MHz
-- out_rate: 64.000000MHz
--
_____________________________________________________
/
| Device: B-Series Device
| _____________________________________________________
| /
| | Mboard: B100
| | revision: 8192
| | serial: E5R10Z1B1
| | FW Version: 4.0
| | FPGA Version: 11.4
| |
| | Time sources: none, external, _external_
| | Clock sources: internal, external, auto
| | Sensors: ref_locked
| | _____________________________________________________
| | /
| | | RX DSP: 0
| | | Freq range: -32.000 to 32.000 Mhz
| | _____________________________________________________
| | /
| | | RX Dboard: A
| | | ID: WBX v3, WBX v3 + Simple GDB (0x0057)
| | | Serial: E5R1BW6XW
| | | _____________________________________________________
| | | /
| | | | RX Frontend: 0
| | | | Name: WBXv3 RX+GDB
| | | | Antennas: TX/RX, RX2, CAL
| | | | Sensors: lo_locked
| | | | Freq range: 68.750 to 2200.000 Mhz
| | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB
| | | | Connection Type: IQ
| | | | Uses LO offset: No
| | | _____________________________________________________
| | | /
| | | | RX Codec: A
| | | | Name: ad9522
| | | | Gain range pga: 0.0 to 20.0 step 1.0 dB
| | _____________________________________________________
| | /
| | | TX DSP: 0
| | | Freq range: -32.000 to 32.000 Mhz
| | _____________________________________________________
| | /
| | | TX Dboard: A
| | | ID: WBX v3 (0x0056)
| | | Serial: E5R1BW6XW
| | | _____________________________________________________
| | | /
| | | | TX Frontend: 0
| | | | Name: WBXv3 TX+GDB
| | | | Antennas: TX/RX, CAL
| | | | Sensors: lo_locked
| | | | Freq range: 68.750 to 2200.000 Mhz
| | | | Gain range PGA0: 0.0 to 31.0 step 1.0 dB
| | | | Connection Type: IQ
| | | | Uses LO offset: No
| | | _____________________________________________________
| | | /
| | | | TX Codec: A
| | | | Name: ad9522
| | | | Gain range pga: -20.0 to 0.0 step 0.1 dB
Where's my fault?
Thanks in advance for any help.

The frontend_tuner_status struct sequence is what defines the device capabilities and capacity. If the sequence is empty, the allocation will always result in lack of capacity. An empty frontend_tuner_status property is usually the result of not specifying the target device, or not being able to find the specified target device.
You must specify the target device using the target_device struct property. This can be done within the Node or at run-time. Previous versions of the USRP_UHD REDHAWK Device only allowed the IP address to be specified using a property, but in order to support USB-connected (and in general, non-network-connected) USRP devices, this has been replaced with the target_device struct property.
The target_device property allows the user to specify ip_address, name, serial, or type, and will use the first USRP hardware device that meets the criteria, if one is found. The information that should be specified in the target_device struct can be determined by setting the update_available_devices property to true, causing the available_devices struct sequence to be populated with all found devices (the same devices and information that is reported by the command line tool uhd_find_devices).
To determine if the USRP_UHD REDHAWK Device is connected to a target device, inspect the properties. Specifically, frontend_tuner_status sequence will be empty if not linked to a hardware device, as well as the device_motherboards and device_channels properties.

Related

when I use the LXC IP on the browser it gives "This site can’t be reached"

Basically I want to establish website with the LXC. so I installed LXD and created LXC called app1, then installed apache2. All are running, but when I use the LXC IP on the browser it gives "This site can’t be reached", I disabled the ufw even though I removed it but nothing happen.
Here are the commands that I did to test with their results:
$ sudo lxc list
| app1 | RUNNING | 10.221.72.14 (eth0) | fd42:969c:2638:6357:216:3eff:fe59:efd7 (eth0) | CONTAINER | 0
$ sudo lxc network ls
| br0 | bridge | NO | | 0 |
+--------+----------+---------+-------------+---------+
| ens3 | physical | NO | | 0 |
+--------+----------+---------+-------------+---------+
| lxdbr0 | bridge | YES | | 2 |
+--------+----------+---------+-------------+---------+
| virbr0 | bridge | NO | | 0 |
$ sudo lxc network show lxdbr0
config:
ipv4.address: 10.221.72.1/24
ipv4.nat: "true"
ipv6.address: fd42:969c:2638:6357::1/64
ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/app1
- /1.0/profiles/default
managed: true
status: Created
locations:
- none

Unable to connect to the PYMQI Client facing FAILED: MQRC_ENVIRONMENT_ERROR

I am getting the below error while connecting to IBM MQ using library pymqi.
Its a clustered MQ channel
Traceback (most recent call last):
File "postToQueue.py", line 432, in <module>
qmgr = pymqi.connect(queue_manager, channel, conn_info)
File "C:\Python\lib\site-packages\pymqi\__init__.py", line 2608, in connect
qmgr.connect_tcp_client(queue_manager or '', CD(), channel, conn_info, user, password)
File "C:\Python\lib\site-packages\pymqi\__init__.py", line 1441, in connect_tcp_client
self.connect_with_options(name, cd, user=user, password=password)
File "C:\Python\lib\site-packages\pymqi\__init__.py", line 1423, in connect_with_options
raise MQMIError(rv[1], rv[2])
pymqi.MQMIError: MQI Error. Comp: 2, Reason 2012: FAILED: MQRC_ENVIRONMENT_ERROR'
Please see my code below.
queue_manager = 'quename here'
channel = 'channel name here'
host ='host-name here'
port = '2333'
queue_name = 'queue name here'
message = 'my message here'
conn_info = '%s(%s)' % (host, port)
print(conn_info)
qmgr = pymqi.connect(queue_manager, channel, conn_info)
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
print("message sent")
queue.close()
qmgr.disconnect()
Getting error at the line below
qmgr = pymqi.connect(queue_manager, channel, conn_info)
Added the IBM client to scripts folder as well , using Windows 10 , Python 3.8.1 and IBM Client 9.1 windows client installation image, Below is the header
-----------------------------------------------------------------------------+
| |
| WebSphere MQ First Failure Symptom Report |
| ========================================= |
| |
| Date/Time :- Tue January 28 2020 16:27:51 Eastern Standard Time |
| UTC Time :- 1580246871.853000 |
| UTC Time Offset :- -300 (Eastern Standard Time) |
| Host Name :- CA-LDLD0SQ2 |
| Operating System :- Windows 10 Enterprise x64 Edition, Build 17763 |
| PIDS :- 5724H7251 |
| LVLS :- 8.0.0.11 |
| Product Long Name :- IBM MQ for Windows (x64 platform) |
| Vendor :- IBM |
| O/S Registered :- 0 |
| Data Path :- C:\Python\Scripts\IBM |
| Installation Path :- C:\Python |
| Installation Name :- MQNI08000011 (126) |
| License Type :- Unknown |
| Probe Id :- XC207013 |
| Application Name :- MQM |
| Component :- xxxInitialize |
| SCCS Info :- F:\build\slot1\p800_P\src\lib\cs\amqxeida.c, |
| Line Number :- 5085 |
| Build Date :- Dec 12 2018 |
| Build Level :- p800-011-181212.1 |
| Build Type :- IKAP - (Production) |
| UserID :- alekhya.machiraju |
| Process Name :- C:\Python\python.exe |
| Arguments :- |
| Addressing mode :- 32-bit |
| Process :- 00010908 |
| Thread :- 00000001 |
| Session :- 00000001 |
| UserApp :- TRUE |
| Last HQC :- 0.0.0-0 |
| Last HSHMEMB :- 0.0.0-0 |
| Last ObjectName :- |
| Major Errorcode :- xecF_E_UNEXPECTED_SYSTEM_RC |
| Minor Errorcode :- OK |
| Probe Type :- INCORROUT |
| Probe Severity :- 2 |
| Probe Description :- AMQ6090: MQM could not display the text for error |
| 536895781. |
| FDCSequenceNumber :- 0 |
| Comment1 :- WinNT error 1082155270 from Open ccsid.tbl. |
| |
+-----------------------------------------------------------------------------+

How to generate single output json object from multiple log lines in logstash filter?

I am new to Logstash and Grok filter. I want to parse logs like these -
2018-01-11 17:17:16,071 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | CommittedVirtualMemorySize :: 401186816
2018-01-11 17:17:16,071 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | FreePhysicalMemorySize :: 1751130112
2018-01-11 17:17:16,072 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | FreeSwapSpaceSize :: 4294967295
2018-01-11 17:17:16,694 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | ProcessCpuLoad :: -1.0
2018-01-11 17:17:16,694 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | ProcessCpuTime :: 47471104300
2018-01-11 17:17:16,698 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | SystemCpuLoad :: 1.0
2018-01-11 17:17:16,698 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | TotalPhysicalMemorySize :: 4285849600
2018-01-11 17:17:16,698 | DEBUG | [Thread-2] | com.example.monitor.MonitorHelper:cpuMonitoring(307) | TotalSwapSpaceSize :: 4294967295
to a JSON Object like this -
{
"timestamp": "2018-01-11 17:17:16,071",
"log_level": "DEBUG",
"thread_name": "Thread-2",
"class": "com.example.monitor.MonitorHelper",
"method": "cpuMonitoring",
"line_number": "307",
"CommittedVirtualMemorySize": "401186816",
"FreePhysicalMemorySize": "1751130112",
"FreeSwapSpaceSize": "4294967295",
"ProcessCpuLoad": "-1.0",
"ProcessCpuTime": "47471104300",
"SystemCpuLoad": "1.0",
"TotalPhysicalMemorySize": "4285849600",
"TotalSwapSpaceSize": "4294967295"
}
As of now my grok pattern is -
%{TIMESTAMP_ISO8601:timestamp} \| %{LOGLEVEL:log_level} \| [(?\b[\w-]+\b)] \| %{JAVAFILE:class}:%{JAVAMETHOD:method}(%{NUMBER:line_number}) \| %{GREEDYDATA:log_message}
which provides multiple output lines for each input log line. JSON object looks like this-
{
"timestamp": "2018-01-11 17:17:16,071",
"log_level": "DEBUG",
"thread_name": "Thread-2",
"class": "com.example.monitor.MonitorHelper",
"method": "cpuMonitoring",
"line_number": "307",
"log_message": "CommittedVirtualMemorySize :: 401186816 "
}
can you please help me with what I need to look for in order to achieve this?
The first recommendation is to change the original log output into a single line.
If you can't, and you're using filebeat to ship the file, use FB's multiline config to merge the lines before sending it to logstash.
If you're not using filebeat, you can try to use the multiline codec in logstash.

Messages are getting struck in apache activemq master-slave configuration

I am facing problem of messages getting struck in activemq queue (with master slave configuration) and consumer is not able to consume messages when I pump around ~100 messages to different queues.
I have configured ActiveMQ (v5.9.0) message broker in two separate linux instances in master-slave mode. For persistenceAdapter conf on both the instances, I have mounted a NAS storage onto both the instances where activemq server is running. Hence same NAS storage is mounted on both activemq instances at mount point '/mnt/nas'. The size of the NAS storage is 20 GB.
So my persistenceAdapter conf looks like below
<persistenceAdapter>
<kahaDB directory="/mnt/nas" ignoreMissingJournalfiles="true" checkForCorruptJournalFiles="true" checksumJournalFiles="true"/>
</persistenceAdapter>
The systemUsage configuration on both activemq server is like below
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap = "70"/>
</memoryUsage>
<storeUsage>
<storeUsage limit = "15 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit = "7 gb"/>
</tempUsage>
</systemUsage>
</systemUsage>
and I have enabled only 'tcp' transport connector
<transportConnector name = "openwire" uri = "tcp://0.0.0.0:61616 maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
When I see the partition details of the mount point '/mnt/nas' on both activemq instances, I see following for the command df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda2 102953264 5840280 91883264 6% /
tmpfs 967652 0 967652 0% /dev/shm
/dev/xvda1 253871 52511 188253 22% /boot
//nas151.service.softlayer.com/IBM278684-16
139328579072 56369051136 82959527936 41% /mnt/nas
Hence I see 41% of /mnt/nas is used
The problem is when I start the activemq server (on both instances), I see the following messages in the activemq.log
**************** START ***************
2014-06-05 12:48:40,350 | INFO | PListStore:[/var/lib/apache-activemq-5.9.0/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2014-06-05 12:48:40,454 | INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi | org.apache.activemq.broker.jmx.ManagementContext | JMX connector
2014-06-05 12:48:40,457 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/mnt/nas] | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:40,612 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 8163..8209 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,613 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 12256..12327 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,649 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 20420..20585 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,650 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 28559..28749 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,651 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 32677..32842 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,652 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 36770..36960 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,655 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 49099..49264 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,657 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 61403..61474 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,658 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 65521..65567 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,659 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 69614..69685 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,660 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 77778..77824 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:41,543 | INFO | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,592 | INFO | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,604 | INFO | Recovery replayed 66 operations from the journal in 0.028 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,772 | INFO | Apache ActiveMQ 5.9.0 (localhost, ID:10.106.99.101-60576-1401972521638-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,892 | INFO | Listening for connections at: tcp://10.106.99.101:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2014-06-05 12:48:41,893 | INFO | Connector openwire started | org.apache.activemq.broker.TransportConnector | main
2014-06-05 12:48:41,893 | INFO | Apache ActiveMQ 5.9.0 (localhost, ID:10.106.99.101-60576-1401972521638-0:1) started | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,893 | INFO | For help or more information please see: http://activemq.apache.org | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,897 | WARN | Store limit is 2048 mb, whilst the data directory: /mnt/nas only has 0 mb of usable space - resetting to maximum available disk space: 0 mb | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,897 | ERROR | Store limit is 0 mb, whilst the max journal file size for the store is: 32 mb, the store will not accept any data when used. | org.apache.activemq.broker.BrokerService | main
******************** END **************
I see 'Corrupt journal records found in '/mnt/nas/db-1.log'. This comes for everytime restart even though if I delete this file and restart.
I had put the flag to recover but still this log entry comes for every restart.
Another problem is, even though my NAS storage is 20GB, it shows '/mnt/nas only has 0 mb of usable space'. This is really weird. I am not sure why 0 MB is available to activemq
I request people here to give me some suggestions on why it is happening like this and suggest me any better configurations to avoid messages getting struck in queue.
Thanks
Raagu

How to include modules for code coverage for unit testing?

My assumption is that any module tested using Intern will automatically be covered by Istanbul's code coverage. For reasons unknown to me, my module is not being included.
I am:
running Intern 1.6.2 (installed with npm locally)
testing NodeJS code
using callbacks, not promises
using CommonJS modules, not AMD modules
Directory Structure (only showing relevant files):
plister
|
|--libraries
| |--file-type-support.js
|
|--tests
| |--intern.js
| |--unit
| |--file-type-support.js
|
|--node_modules
|--intern
plister/tests/intern.js
define({
useLoader: {
'host-node': 'dojo/dojo'
},
loader: {
packages: [
{name: 'libraries', location: 'libraries'}
]
},
reporters: ['console'],
suites: ['tests/unit/file-type-support'],
functionalSuites: [],
excludeInstrumentation: /^(tests|node_modules)\//
});
plister/tests/unit/file-type-support.js
define([
'intern!bdd',
'intern/chai!expect',
'intern/dojo/node!fs',
'intern/dojo/node!path',
'intern/dojo/node!stream-equal',
'intern/dojo/node!../../libraries/file-type-support'
], function (bdd, expect, fs, path, streamEqual, fileTypeSupport) {
'use strict';
bdd.describe('file-type-support', function doTest() {
bdd.it('should show that the example output.plist matches the ' +
'temp.plist generated by the module', function () {
var deferred = this.async(),
input = path.normalize('tests/resources/input.plist'),
output = path.normalize('tests/resources/output.plist'),
temporary = path.normalize('tests/resources/temp.plist');
// Test deactivate function by checking output produced by
// function against test output.
fileTypeSupport.deactivate(fs.createReadStream(input),
fs.createWriteStream(temporary),
deferred.rejectOnError(function onFinish() {
streamEqual(fs.createReadStream(output),
fs.createReadStream(temporary),
deferred.callback(function checkEqual(error, equal) {
expect(equal).to.be.true;
}));
}));
});
});
});
Output:
PASS: main - file-type-support - should show that the example output.plist matches the temp.plist generated by the module (29ms)
1/1 tests passed
1/1 tests passed
Output (on failure):
FAIL: main - file-type-support - should show that the example output.plist matches the temp.plist generated by the module (30ms)
AssertionError: expected true to be false
AssertionError: expected true to be false
0/1 tests passed
0/1 tests passed
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
Output (after removing excludeInstrumentation):
PASS: main - file-type-support - should show that the example output.plist matches the temp.plist generated by the module (25ms)
1/1 tests passed
1/1 tests passed
------------------------------------------+-----------+-----------+-----------+-----------+
File | % Stmts |% Branches | % Funcs | % Lines |
------------------------------------------+-----------+-----------+-----------+-----------+
node_modules/intern/ | 70 | 50 | 100 | 70 |
chai.js | 70 | 50 | 100 | 70 |
node_modules/intern/lib/ | 79.71 | 42.86 | 72.22 | 79.71 |
Test.js | 79.71 | 42.86 | 72.22 | 79.71 |
node_modules/intern/lib/interfaces/ | 80 | 50 | 63.64 | 80 |
bdd.js | 100 | 100 | 100 | 100 |
tdd.js | 76.19 | 50 | 55.56 | 76.19 |
node_modules/intern/lib/reporters/ | 56.52 | 35 | 57.14 | 56.52 |
console.js | 56.52 | 35 | 57.14 | 56.52 |
node_modules/intern/node_modules/chai/ | 37.9 | 8.73 | 26.38 | 39.34 |
chai.js | 37.9 | 8.73 | 26.38 | 39.34 |
tests/unit/ | 100 | 100 | 100 | 100 |
file-type-support.js | 100 | 100 | 100 | 100 |
------------------------------------------+-----------+-----------+-----------+-----------+
All files | 42.14 | 11.35 | 33.45 | 43.63 |
------------------------------------------+-----------+-----------+-----------+-----------+
My module passes the test and I can make it fail too. It just will not show up in the code coverage. I have done the tutorial hosted on GitHub without any problems.
I tried dissecting the Istanbul and Intern dependencies. I place a console.log where it seems files to be covered go through, but my module doesn't get passed. I have tried every variation of deferred.callback and deferred.rejectOnError with no difference to the code coverage.
Also, any feedback on my use of deferred.callback and deferred.rejectOnError will be greatly appreciated. I am still a little uncertain on their usage.
Thanks!
As of Intern 1.6, only require('vm').runInThisContext is hooked to add code coverage data, not require. Instrumentation of require was added in Intern 2.0.
The use of callback/rejectOnError in the above code is correct.

Resources