Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 35190b4

Browse files
committed
add meta.com.tr to testdata after simplefy regexes for date
1 parent 3946c47 commit 35190b4

File tree

4 files changed

+95
-20
lines changed

4 files changed

+95
-20
lines changed

DONE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ DONE
2121
either \r or trailing whitespace, this can be done later and would make many regexes simpler in end detection
2222

2323
- simplefy com.tr regex from multiple . to \.+, and add note on the trailing dot behind the date
24+
add meta.com.tr to regular testdata

testdata/make_testdata.sh

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
#! /usr/bin/bash
22

3-
DOMAINS=(
4-
example.net # has iana source
5-
example.com # has iana source
6-
example.org # has no iana source
7-
meta.co.uk # has multiline for all relevant fields and 4 nameservers; should be fixed output has only 2
8-
xs4all.nl # has multiline nameserver and multiline registrar; outout has no nameservers should be 2
9-
meta.com.sg # has mail
10-
meta.com # have emails
11-
google.com # have emails
12-
meta.jp # jp has [registrar] type keywords not registrar:
13-
meta.co.jp # jp has [registrar] type keywords not registrar:
14-
meta.kr # has both korean and english text
15-
)
16-
17-
for str in ${DOMAINS[@]}
18-
do
19-
echo "$str"
3+
getDomains()
4+
{
5+
DOMAINS=(
6+
example.net # has iana source
7+
example.com # has iana source
8+
example.org # has no iana source
9+
meta.co.uk # has multiline for all relevant fields and 4 nameservers; should be fixed output has only 2
10+
xs4all.nl # has multiline nameserver and multiline registrar; outout has no nameservers should be 2
11+
meta.com.sg # has mail
12+
meta.com # have emails
13+
google.com # have emails
14+
meta.jp # jp has [registrar] type keywords not registrar:
15+
meta.co.jp # jp has [registrar] type keywords not registrar:
16+
meta.kr # has both korean and english text
17+
meta.com.tr # has utf 8 response text and different formatting style
18+
)
19+
}
20+
21+
makeDataForDomain()
22+
{
23+
local str="$1"
2024

2125
# create one dir for each domain we will test
2226
mkdir -p "$str"
2327

2428
# dump the raw whois data as in
25-
whois "$str" | tee "./$str/input"
29+
whois "$str" |
30+
tee "./$str/input"
2631

2732
# dump the expected output as output
28-
../test2.py -d "$str" | tee "./$str/output"
29-
done
33+
../test2.py -d "$str" |
34+
tee "./$str/output"
35+
}
36+
37+
makeDataIfNotExist()
38+
{
39+
for str in ${DOMAINS[@]}
40+
do
41+
[ -d "$str" ] && continue
42+
makeDataForDomain "$str"
43+
done
44+
}
45+
46+
main()
47+
{
48+
getDomains
49+
makeDataIfNotExist
50+
}
51+
52+
main

testdata/meta.com.tr/input

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[Querying whois.nic.tr]
2+
[whois.nic.tr]
3+
** Domain Name: meta.com.tr
4+
Frozen Status: -
5+
Transfer Status: The domain is LOCKED to transfer.
6+
7+
** Registrant:
8+
Meta İnşaat ve Ticaret Ltd. Şti.
9+
Hidden upon user request
10+
Hidden upon user request
11+
Hidden upon user request
12+
Hidden upon user request
13+
14+
15+
** Registrar:
16+
NIC Handle : ogv40-metu
17+
Organization Name : ODTÜ GELİŞTİRME VAKFI BİLGİ TEKNOLOJİLERİ SAN. VE TİC. A.Ş.
18+
Address : ÜNİVERSİTELER MAH. İHSAN DOĞRAMACI BLV.
19+
ARGE VE EĞİTİM MERKEZİ NO:13 ÇANKAYA
20+
06800 Ankara Türkiye
21+
Phone : 90-312-9881106-
22+
Fax : -
23+
24+
25+
** Domain Servers:
26+
ns1.efektyazilim.com
27+
ns2.efektyazilim.com
28+
29+
30+
** Additional Info:
31+
Created on..............: 2006-Dec-28.
32+
Expires on..............: 2026-Dec-27.
33+
34+
35+
** Whois Server:
36+
Last Update Time: 2022-11-17T14:01:59+03:00

testdata/meta.com.tr/output

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
test domain: <<<<<<<<<< meta.com.tr >>>>>>>>>>>>>>>>>>>>
3+
name str 'meta.com.tr'
4+
tld str 'com_tr'
5+
registrar str 'ODTÜ GELİŞTİRME VAKFI BİLGİ TEKNOLOJİLERİ SAN. VE TİC. A.Ş.'
6+
registrant_country str ''
7+
creation_date datetime.datetime 2006-12-28 00:00:00
8+
expiration_date datetime.datetime 2026-12-27 00:00:00
9+
last_updated NoneType None
10+
status str ''
11+
statuses list ['']
12+
dnssec bool False
13+
name_servers list ['ns1.efektyazilim.com', 'ns2.efektyazilim.com']
14+
registrant str 'Meta İnşaat ve Ticaret Ltd. Şti.'
15+
emails list ['']

0 commit comments

Comments
 (0)