why pcap_open_dead filed.
Write the pcap file manually.
Now it's able to save traffic to pcap file.
It looks that Lua test case script works fine.