mirror of
https://github.com/mvt-project/mvt.git
synced 2026-05-20 23:44:45 +02:00
Initial tests for tombstone parsing
This commit is contained in:
@@ -4,27 +4,37 @@
|
||||
# https://license.mvt.re/1.1/
|
||||
|
||||
from mvt.android.artifacts.tombstone_crashes import TombstoneCrashArtifact
|
||||
from mvt.android.parsers.proto.tombstone import Tombstone
|
||||
|
||||
from ..utils import get_artifact
|
||||
|
||||
|
||||
class TestTombstoneCrashArtifact:
|
||||
def test_tombtone_process_parsing(self):
|
||||
tombstone_artifact = TombstoneCrashArtifact()
|
||||
file = get_artifact("android_data/tombstone_process.txt")
|
||||
# def test_tombtone_process_parsing(self):
|
||||
# tombstone_artifact = TombstoneCrashArtifact()
|
||||
# file = get_artifact("android_data/tombstone_process.txt")
|
||||
# with open(file, "rb") as f:
|
||||
# data = f.read()
|
||||
|
||||
# tombstone_artifact.parse_text(data)
|
||||
# assert len(tombstone_artifact.results) == 1
|
||||
|
||||
# def test_tombtone_kernel_parsing(self):
|
||||
# tombstone_artifact = TombstoneCrashArtifact()
|
||||
# file = get_artifact("android_data/tombstone_kernel.txt")
|
||||
# with open(file, "rb") as f:
|
||||
# data = f.read()
|
||||
|
||||
# tombstone_artifact.parse_text(data)
|
||||
# assert len(tombstone_artifact.results) == 1
|
||||
|
||||
def test_tombstone_pb_process_parsing(self):
|
||||
file = get_artifact("android_data/tombstone_process.pb")
|
||||
with open(file, "rb") as f:
|
||||
data = f.read()
|
||||
|
||||
tombstone_artifact.parse(data)
|
||||
|
||||
assert len(tombstone_artifact.results) == 1
|
||||
|
||||
def test_tombtone_kernel_parsing(self):
|
||||
tombstone_artifact = TombstoneCrashArtifact()
|
||||
file = get_artifact("android_data/tombstone_kernel.txt")
|
||||
with open(file, "rb") as f:
|
||||
data = f.read()
|
||||
|
||||
tombstone_artifact.parse(data)
|
||||
|
||||
assert len(tombstone_artifact.results) == 1
|
||||
parsed_tombstone = Tombstone().parse(data)
|
||||
assert parsed_tombstone
|
||||
assert parsed_tombstone.command_line == ["/vendor/bin/hw/android.hardware.media.c2@1.2-mediatek"]
|
||||
assert parsed_tombstone.uid == 1046
|
||||
assert parsed_tombstone.timestamp == "2023-04-12 12:32:40.518290770+0200"
|
||||
|
||||
Reference in New Issue
Block a user