File: _put_file.yml

package info (click to toggle)
python-mitogen 0.3.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,708 kB
  • sloc: python: 24,457; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (31 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: Create {{ file_name }}
  command:
    cmd: dd if=/dev/urandom of=/tmp/{{ file_name }} bs=1024 count={{ file_size_kib }}
    creates: /tmp/{{file_name}}
  delegate_to: localhost
  run_once: true

- name: Copy {{ file_name }}
  copy:
    dest: /tmp/{{file_name}}.out
    src: /tmp/{{file_name}}
    mode: "{{ file_mode }}"

- name: Stat created {{ file_name }}
  stat: path=/tmp/{{ file_name }}
  register: original
  delegate_to: localhost
  run_once: true

- name: Stat copied {{ file_name }}
  stat: path=/tmp/{{ file_name }}.out
  register: copied

- assert:
    that:
    - original.stat.checksum == copied.stat.checksum
    # Upstream does not preserve timestamps at al.
    #- (not is_mitogen) or (original.stat.mtime|int == copied.stat.mtime|int)
    fail_msg: |
      original={{ original }}
      copied={{ copied }}