-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathTest.sh
More file actions
89 lines (70 loc) · 3.34 KB
/
Test.sh
File metadata and controls
89 lines (70 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
# Test from local build:
# docker run -it --rm --name PlexCleaner-Test plexcleaner:ubuntu /Test/Test.sh
# Test from docker hub build using local media:
# docker run \
# -it \
# --rm \
# --pull always \
# --user nobody:users \
# --name PlexCleaner-Test \
# --env TZ=America/Los_Angeles \
# --volume /data/media/test:/Test/Media:rw \
# --volume /data/media/PlexCleaner/PlexCleaner-Develop.json:/Test/PlexCleaner.json:rw \
# docker.io/ptr727/plexcleaner:ubuntu \
# /Test/Test.sh
# Use debug build for testing
PlexCleanerApp=/PlexCleaner/Debug/PlexCleaner
# Test files
MediaPath=/Test/Media
# Settings file
SettingsFile=/Test/PlexCleaner.json
# Test path
TestPath=/Test
# Echo commands
set -x
# Exit on error
set -e
# Test for "/Test/Media" directory
if [ ! -d $MediaPath ]; then
# Download Matroska test files: https://github.com/ietf-wg-cellar/matroska-test-files
wget --progress=bar:force -O $TestPath/matroska-test-files.zip https://github.com/ietf-wg-cellar/matroska-test-files/archive/refs/heads/master.zip
7z e -o$MediaPath $TestPath/matroska-test-files.zip *.mkv -r
rm $TestPath/matroska-test-files.zip
fi
# Basic commands (no settings file required)
$PlexCleanerApp --version
$PlexCleanerApp --help
$PlexCleanerApp defaultsettings --settingsfile $TestPath/PlexCleaner.default.json
$PlexCleanerApp createschema --schemafile $TestPath/PlexCleaner.schema.json
# Test for "/Test/PlexCleaner.json" file
if [ ! -e $SettingsFile ]; then
# Use default config
cp $TestPath/PlexCleaner.default.json $SettingsFile
fi
# Basic commands (settings file required)
$PlexCleanerApp getversioninfo --settingsfile $SettingsFile
# Not supported on Linux
# $PlexCleanerApp checkfornewtools --settingsfile $SettingsFile
# File processing commands (settings file required, media files required)
# Take care of order of commands to not interfere with sidecar logic
# Run process command first
$PlexCleanerApp process --settingsfile $SettingsFile --logfile $TestPath/PlexCleaner.log --logwarning --mediafiles $MediaPath --testsnippets --resultsfile $TestPath/Results.json
# Info/Testing commands
$PlexCleanerApp verify --settingsfile $SettingsFile --mediafiles $MediaPath --quickscan
$PlexCleanerApp testmediainfo --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp updatesidecar --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp getsidecarinfo --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp gettagmap --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp getmediainfo --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp gettoolinfo --settingsfile $SettingsFile --mediafiles $MediaPath
# Run createsidecar after sidecar state is no longer required
$PlexCleanerApp createsidecar --settingsfile $SettingsFile --mediafiles $MediaPath
# Processing commands
$PlexCleanerApp remux --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp reencode --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp deinterlace --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp removesubtitles --settingsfile $SettingsFile --mediafiles $MediaPath
$PlexCleanerApp removeclosedcaptions --settingsfile $SettingsFile --mediafiles $MediaPath --quickscan
# Not readily testable
# $PlexCleanerApp monitor --settingsfile $SettingsFile --mediafiles $MediaPath