about summary refs log tree commit diff stats
path: root/core/scripts
Commit message (Collapse)AuthorAgeFilesLines
* core linux, backup and iptables script fixSilvino Silva2018-07-162-55/+138
|
* setup-iso revisionSilvino Silva2018-07-091-18/+85
|
* fix iptables let ssh out if serverSilvino Silva2018-06-121-6/+8
|
* network, iptables, sshd config fix'sSilvino Silva2018-06-122-280/+331
|
* allow client https to tap2Silvino Silva2018-05-061-1/+5
|
* added https client to server iptablesSilvino Silva2018-05-061-1/+2
|
* added dns server to brigdeSilvino Silva2018-05-061-0/+3
|
* iptables server revisionSilvino Silva2018-05-062-6/+21
|
* iptables, failtoban and dnsmasq revisionSilvino Silva2018-05-063-409/+32
|
* initial iptables revisionSilvino Silva2018-05-062-372/+292
|
* iptables moved to coreSilvino Silva2018-04-112-0/+803
|
* added extra packages to install coreSilvino Silva2018-03-061-1/+6
|
* core install revisionSilvino Silva2018-02-257-406/+455
|
* fix setup-install fstabSilvino Silva2017-08-111-9/+7
|
* tools qemu and core setup scripts revisionSilvino Silva2017-08-064-102/+307
|
* first hardened testSilvino Silva2017-08-023-184/+280
|
* core index correctionSilvino Silva2017-02-251-17/+62
|
* overall revesionSilvino Silva2017-02-251-1/+1
|
* fix core install and portsSilvino Silva2017-02-191-1/+1
|
* install update to crux 3.3Silvino Silva2017-02-185-122/+157
|
* Deleted iptables script with many errors,Silvino Silva2016-10-162-334/+1
| | | | | added simple rules.v4 file that can be used by iptables-restore
* core revisionSilvino Silva2016-10-156-266/+306
|
* core scripts revisionSilvino Silva2016-10-085-196/+219
|
* tar backup script fixSilvino Silva2016-09-221-2/+4
|
* updated core linux ports and iptables scriptSilvino Silva2016-09-171-9/+18
|
* core packages revision, iptables and added ports collectionsSilvino Silva2016-09-151-0/+1
|
* network revisionSilvino Silva2016-09-121-7/+12
|
* added all core filesSilvino Silva2016-08-223-0/+354
|
* first doc core os revisionSilvino Silva2016-08-226-0/+369
class="p">, 'fskldfjl')])) self.assertEqual( ['a', 'b', 'fskldfjl'], f(['a', deque(['b', 'fskldfjl'])])) self.assertEqual( set([3.5, 4.3, 5.2, 6.0]), set(f([6.0, set((3.5, 4.3)), (5.2, )]))) def test_unique(self): def u(x): return list(unique(x)) self.assertEqual( [1,2,3], u([1,2,3])) self.assertEqual( [1,2,3], u([1,2,3,2,1])) self.assertEqual( [1,2,3], u([1,2,3,1,2,3,2,2,3,1,2,3,1,2,3,2,3,2,1])) self.assertEqual( [1,[2,3]], u([1,[2,3],1,[2,3],[2,3],1,[2,3],1,[2,3],[2,3],1])) def test_unique_keeps_type(self): def u(x): return unique(x) self.assertEqual( [1,2,3], u([1,2,3,1])) self.assertEqual( (1,2,3), u((1,2,3,1))) self.assertEqual( set((1,2,3)), u(set((1,2,3,1)))) self.assertEqual( deque((1,2,3)), u(deque((1,2,3,1)))) def test_mount_path(self): # assuming ismount() is used def my_ismount(path): depth = path.count('/') if path.startswith('/media'): return depth == 0 or depth == 2 return depth <= 1 from ranger.ext import mount_path original_ismount = mount_path.ismount mount_path.ismount = my_ismount try: mp = mount_path.mount_path self.assertEqual('/home', mp('/home/hut/porn/bondage')) self.assertEqual('/', mp('/')) self.assertEqual('/media/sdb1', mp('/media/sdb1/foo/bar')) self.assertEqual('/media/sdc2', mp('/media/sdc2/a/b/c/d/e')) finally: mount_path.ismount = original_ismount # TODO: links are not tested but I don't see how its possible # without messing around with mounts. # self.assertEqual('/media/foo', # mount_path('/media/bar/some_link_to_a_foo_subdirectory')) def test_openstruct(self): from ranger.ext.openstruct import OpenStruct from random import randint, choice from string import ascii_letters os = OpenStruct(a='a') self.assertEqual(os.a, 'a') self.assertRaises(AttributeError, getattr, os, 'b') dictionary = {'foo': 'bar', 'zoo': 'zar'} os = OpenStruct(dictionary) self.assertEqual(os.foo, 'bar') self.assertEqual(os.zoo, 'zar') self.assertRaises(AttributeError, getattr, os, 'sdklfj') for i in range(100): attr_name = ''.join(choice(ascii_letters) \ for x in range(randint(3,9))) value = randint(100,999) if not attr_name in os: self.assertRaises(AttributeError, getattr, os, attr_name) setattr(os, attr_name, value) value2 = randint(100,999) setattr(os, attr_name, value2) self.assertEqual(value2, getattr(os, attr_name)) def test_shell_escape(self): from ranger.ext.shell_escape import shell_escape, shell_quote self.assertEqual(r"'luigi'\''s pizza'", shell_quote("luigi's pizza")) self.assertEqual(r"luigi\'s\ pizza", shell_escape("luigi's pizza")) self.assertEqual(r"\$lol/foo\\xyz\|\>\<\]\[", shell_escape(r"$lol/foo\xyz|><][")) if __name__ == '__main__': unittest.main()