- Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathtest-builder-deprecated.sh
executable file
·91 lines (68 loc) · 4.19 KB
/
test-builder-deprecated.sh
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
90
91
#!/bin/bash
#
# Copyright © 2022 Red Hat, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -euo pipefail
srcdir=$(dirname "$0")
."$srcdir"/libtest.sh
skip_without_fuse
echo"1..8"
setup_repo
install_repo
setup_sdk_repo
install_sdk_repo
cd"$TEST_DATA_DIR"
cp "$srcdir"/org.test.Deprecated.MD5.archive.json .
cp "$srcdir"/org.test.Deprecated.MD5.archive.yaml .
cp "$srcdir"/org.test.Deprecated.MD5.file.json .
cp "$srcdir"/org.test.Deprecated.MD5.file.yaml .
cp "$srcdir"/org.test.Deprecated.SHA1.archive.json .
cp "$srcdir"/org.test.Deprecated.SHA1.archive.yaml .
cp "$srcdir"/org.test.Deprecated.SHA1.file.json .
cp "$srcdir"/org.test.Deprecated.SHA1.file.yaml .
cp "$srcdir"/hello.sh .
cp "$srcdir"/hello.tar.xz .
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.MD5.archive.json >&22> build-error-log
assert_file_has_content build-error-log 'The "md5" source property is deprecated due to the weakness of MD5 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated MD5 hash for archive in JSON"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.MD5.archive.yaml >&22> build-error-log
assert_file_has_content build-error-log 'The "md5" source property is deprecated due to the weakness of MD5 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated MD5 hash for archive in YAML"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.MD5.file.json >&22> build-error-log
assert_file_has_content build-error-log 'The "md5" source property is deprecated due to the weakness of MD5 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated MD5 hash for file in JSON"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.MD5.file.yaml >&22> build-error-log
assert_file_has_content build-error-log 'The "md5" source property is deprecated due to the weakness of MD5 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated MD5 hash for file in YAML"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.SHA1.archive.json >&22> build-error-log
assert_file_has_content build-error-log 'The "sha1" source property is deprecated due to the weakness of SHA1 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated SHA1 hash for archive in JSON"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.SHA1.archive.yaml >&22> build-error-log
assert_file_has_content build-error-log 'The "sha1" source property is deprecated due to the weakness of SHA1 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated SHA1 hash for archive in YAML"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.SHA1.file.json >&22> build-error-log
assert_file_has_content build-error-log 'The "sha1" source property is deprecated due to the weakness of SHA1 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated SHA1 hash for file in JSON"
${FLATPAK_BUILDER} --force-clean appdir org.test.Deprecated.SHA1.file.yaml >&22> build-error-log
assert_file_has_content build-error-log 'The "sha1" source property is deprecated due to the weakness of SHA1 hashes.'
assert_file_has_content build-error-log 'Use the "sha256" property for the more secure SHA256 hash.'
echo"ok deprecated SHA1 hash for file in YAML"