| 1 | #!/bin/dash |
| 2 | |
| 3 | # Copyright (C) 2013 Loïc Minier <[email protected]> |
| 4 | |
| 5 | # This program is free software; you can redistribute it and/or |
| 6 | # modify it under the terms of the GNU General Public License |
| 7 | # as published by the Free Software Foundation; either version 2 |
| 8 | # of the License, or (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, |
| 18 | # USA. |
| 19 | |
| 20 | . ./testlib |
| 21 | |
| 22 | MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)" |
| 23 | |
| 24 | test_no_unknown_fields() { |
| 25 | local expected='Android-Boot-Device Boot-Device Boot-DTB-Path Boot-Initrd-Path Boot-Kernel-Path Boot-Multi-Path Boot-Script-Path Bootloader-Sets-Incorrect-Root DTB-Append DTB-Append-From DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name' |
| 26 | expected="$(echo "$expected" | sed 's/ /\n/g' | sort -u | xargs)" |
| 27 | local fields="$(echo "$MACHINE_DB" | sed -n '/^[^#]*:/s/:.*//p' | sort -u | xargs)" |
| 28 | if [ "$fields" != "$expected" ]; then |
| 29 | return 1 |
| 30 | fi |
| 31 | return 0 |
| 32 | } |
| 33 | add_test test_no_unknown_fields |
| 34 | |
| 35 | |
| 36 | test_main |
| 37 | |
| 38 | # vim:syntax=sh |