summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiubov Chuprikova <chuprikovalv@gmail.com>2018-04-13 18:37:49 +0000
committerLiubov Chuprikova <chuprikovalv@gmail.com>2018-04-13 18:37:49 +0000
commitfac5500e8e9b2339d2c9d2a5f534022ba8a0ebe2 (patch)
treeeb9838e3916a762d13e1c6a87a5cf82192210241
parentc44833bce4eba98d49c35fb6f2df58873ce76af9 (diff)
Autopkgtest: check if NCBI is available to start testing
-rw-r--r--debian/tests/control2
-rw-r--r--debian/tests/run-unit-test31
2 files changed, 17 insertions, 16 deletions
diff --git a/debian/tests/control b/debian/tests/control
index d2aa55ae..2d33ca5e 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
Tests: run-unit-test
-Depends: @
+Depends: netcat, @
Restrictions: allow-stderr
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
index f78cfa30..fb4ac173 100644
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -113,21 +113,22 @@ end_out="$(grep -c "<Object-id_id>${last_id}</Object-id_id>" dsRNA_viruses.xgs)"
[ $end_in -eq $end_out ]
-## _insdseqget_ and _idfetch_ testing requires internet connection.
-## Uncomment the lines below to run the tests provided.
-#grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
-###################################################################
-#echo '---insdseqget test---'
-###################################################################
-#/usr/bin/insdseqget -i GIs.txt > insdset.xml
-#[ -s insdset.xml ]
-#check_GI insdset.xml GIs.txt
-###################################################################
-#echo '---idfetch test---'
-###################################################################
-#/usr/bin/idfetch -G GIs.txt -o idfetch.text
-#[ -s idfetch.text ]
-#check_GI idfetch.text GIs.txt
+if nc -z -w 1 www.ncbi.nlm.nih.gov 80; then
+ grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
+
+ ##################################################################
+ echo '---insdseqget test---'
+ ##################################################################
+ /usr/bin/insdseqget -i GIs.txt > insdset.xml
+ [ -s insdset.xml ]
+ check_GI insdset.xml GIs.txt
+ ##################################################################
+ echo '---idfetch test---'
+ ##################################################################
+ /usr/bin/idfetch -G GIs.txt -o idfetch.text
+ [ -s idfetch.text ]
+ check_GI idfetch.text GIs.txt
+fi
##################################################################