diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-07-15 09:29:43 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-08-24 12:05:06 +0200 |
| commit | 6db8af716fb0995966f00e2d52d2f3baa43ea868 (patch) | |
| tree | a6c3c1d9713cc1393d6ceb4b64fa9e89f30bf4a2 /pkg/asset | |
| parent | b6ee202aee2a31a8a21e174548a39c54e3063f1c (diff) | |
dashboard: implement asset storage
Asset is a file/attachment relevant for debugging a kernel crash or the
syzbot itself.
Dashboard keeps track of the uploaded assets and manages their lifetime.
Some of the assets are attached to the bug reports sent by syzkaller,
some (like html coverage report) are displayed on the web portal.
Two new API requests:
* add_build_assets -- let dashboard remember one more build-related
asset.
* needed_assets -- query the list of assets that are still needed by the
dashboard.
Diffstat (limited to 'pkg/asset')
| -rw-r--r-- | pkg/asset/type.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pkg/asset/type.go b/pkg/asset/type.go new file mode 100644 index 000000000..1f3f2f220 --- /dev/null +++ b/pkg/asset/type.go @@ -0,0 +1,37 @@ +// Copyright 2022 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package asset + +import "github.com/google/syzkaller/sys/targets" + +type Type string + +// Asset types used throughout the system. +const ( + BootableDisk Type = "bootable_disk" + NonBootableDisk Type = "non_bootable_disk" + KernelObject Type = "kernel_object" + KernelImage Type = "kernel_image" + HTMLCoverageReport Type = "html_coverage_report" +) + +func GetHumanReadableName(assetType Type, target *targets.Target) string { + switch assetType { + case BootableDisk: + return "disk image" + case NonBootableDisk: + return "disk image (non-bootable)" + case KernelImage: + return "kernel image" + case KernelObject: + if target != nil && target.KernelObject != "" { + return target.KernelObject + } + return "kernel object" + case HTMLCoverageReport: + return "coverage report (html)" + default: + panic("invalid asset type: " + assetType) + } +} |
