File: 06-hide_parent.test

package info (click to toggle)
nginx 1.18.0-6.1%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,344 kB
  • sloc: ansic: 250,653; perl: 7,548; sh: 1,408; ruby: 879; python: 358; makefile: 338; awk: 36; cpp: 18
file content (23 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/bash
cat <<---
This test check the output using "fancyindex_hide_parent_dir on"
--
use pup
nginx_start 'fancyindex_hide_parent_dir on;'

content=$( fetch /child-directory/ )

# Check page title
[[ $(pup -p title text{} <<< "${content}") = "Index of /child-directory/" ]]

# Check table headers
[[ $(pup -n body table tbody tr:first-child td <<< "${content}") -eq 3 ]]
{
	read -r name_label
	read -r size_label
	read -r date_label
} < <(  pup -p body table tbody tr:first-child td text{} <<< "${content}" )
[[ ${name_label} != Parent\ Directory/ ]]
[[ ${name_label} = empty-file.txt ]]
[[ ${size_label} != - ]]
[[ ${date_label} != - ]]